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, how they find the site and where they get stuck, so we can improve it (Google Analytics, Microsoft Clarity).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, LinkedIn, Meta, 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.6k 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 App

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 or Tenant Administrator configures OAuth 2.0. For general OAuth configuration, see OAuth 2.0 Support.

The mobile app uses the OAuth 2.0 clients selected in its bundle. Create the client first and then select it in the bundle, or create it directly from the bundle.

Option 1: Create the client, then select it in the bundle

Section titled “Option 1: Create the client, then select it in the bundle”
  1. Go to Security → OAuth 2.0 in the left main menu and open the OAuth 2.0 clients tab.
  2. Click + Add OAuth 2.0 client, configure the provider, and make sure Android and/or iOS are among its allowed platforms.
  3. Go to Mobile apps → Bundles and click the target bundle.
  4. Open the OAuth 2.0 tab, turn on Enable OAuth 2.0, and select the client in the OAuth 2.0 clients field.
  5. Click Next through the remaining steps and save the bundle.

Option 2: Create the client from the bundle

Section titled “Option 2: Create the client from the bundle”
  1. Go to Mobile apps → Bundles and click the target bundle.
  2. Open the OAuth 2.0 tab, turn on Enable OAuth 2.0, and click Create new next to the OAuth 2.0 clients field.
  3. Configure the provider and click Add. The new client is selected in the bundle.
  4. Click Next through the remaining steps and save the bundle.

The app takes its OAuth 2.0 settings from the bundle configuration file. No code changes are needed.

  1. Go to Mobile apps → Bundles and click the Configuration app button in the row of the target bundle.

  2. Click Download file to get configs.json. It contains the callback URL scheme (thingsboardOAuth2CallbackUrlScheme) and the application secrets the app uses for OAuth 2.0.

  3. Put configs.json in the project root, next to pubspec.yaml, replacing the existing file if you downloaded one earlier.

  4. Rebuild the app:

    Terminal window
    flutter run --dart-define-from-file=configs.json

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.