Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read and how they find the site, so we can improve it (Google Analytics).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors
22.5k Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

Configure OAuth 2.0 in ThingsBoard Mobile Application

The mobile app supports OAuth 2.0 authentication. When configured, additional sign-in buttons appear on the login screen so users can authenticate with the configured OAuth 2.0 provider. A System Administrator configures OAuth 2.0. For general OAuth configuration, see OAuth 2.0 Support.

  1. As a System Administrator, go to System Settings → OAuth2.
  2. Expand the domains panel.
  3. Open the Mobile applications tab and click Add application.
  4. Enter your application package name — for Android: the Application ID; for iOS: the Product Bundle Identifier.
  5. Copy the auto-generated Application secret, or enter your own.
  6. Click Save in the bottom-right corner to apply the changes.

Open the `flutter_thingsboard_app` project in your editor. Edit lib/constants/app_constants.dart:

  • Set thingsboardOAuth2AppSecret to the Application secret value from the previous step.
  • Set thingsboardOAuth2CallbackUrlScheme to a unique scheme — for example, your application package name with an auth suffix (like org.mycompany.myapp.auth).
abstract class ThingsboardAppConstants {
// ...
static final thingsboardOAuth2CallbackUrlScheme = 'Your callback url scheme here';
static final thingsboardOAuth2AppSecret = 'Your app secret here';
}

Next, edit android/app/src/main/AndroidManifest.xml. Find TbWebCallbackActivity and set its scheme to the same value as thingsboardOAuth2CallbackUrlScheme:

<activity android:name=".TbWebCallbackActivity">
<intent-filter android:label="tb_web_auth">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="Your callback url scheme here" />
</intent-filter>
</activity>

Run the mobile app. The login screen should show the OAuth 2.0 sign-in button(s) at the top. Use one to log in as an existing user to confirm the setup works.