Application-Level Clients

Learn how to configure and manage application-level OAuth2 clients for authenticating users and machines across your application's tenants.

Overview

Application-level OAuth2 clients allow your application to authenticate users across multiple tenants or authenticate internal services without user involvement.

You can create the following client types at the application level:

  • Backend Server: Authenticates users accessing server-side web applications and optionally supports machine-to-machine authentication.
  • Native: Authenticates users accessing mobile or desktop applications.
  • Machine-to-Machine (M2M): Authenticates backend services and automated processes without user involvement.

A single Wristband application can have multiple OAuth2 clients, allowing you to configure separate clients for different applications, services, or authentication use cases.

Figure 1: An application with multiple OAuth2 clients configured.

For more information about client types, supported grant types, and configuration options, see the OAuth2 Clients documentation.

Application-Level Client Use Cases

The following examples illustrate how application-level clients can support different authentication use cases.

Web and Mobile Applications

Consider an application accessible through three different interfaces:

  • A Next.js web application
  • An Android mobile application
  • An iOS mobile application

Each interface can use a separate OAuth2 client configured for its authentication requirements:

  • Next.js: A Backend Server client that securely stores its client credentials on the backend.
  • Android: A Native client that authenticates users using the Authorization Code flow with PKCE.
  • iOS: A separate Native client that also uses the Authorization Code flow with PKCE.

All three clients belong to the same Wristband application and can authenticate users across the application's tenants.

Figure 2: Separate OAuth2 clients for a web application and two mobile applications.

Backend Microservices

For applications built using a microservice architecture, you can create a separate application-level M2M client for each backend service.

Each service uses its own client ID and secret to authenticate with Wristband using the client_credentials grant type.

Figure 3: Separate application-level M2M clients for backend microservices.

Managing Application-Level Clients With Wristband's Dashboard

You can create, configure, and manage application-level OAuth2 clients through the Wristband Dashboard. The following sections explain how to perform common client management tasks.

Creating a Client

To create a new application-level OAuth2 client:

  1. From the Dashboard Home page, select the application where you want to create the client.
  2. Make sure you're in the Application View.
  3. From the left navigation menu, select OAuth2 Clients.
  4. Click Add Client.

Figure 4: Add a new application-level OAuth2 client.

  1. In the Select Your Client Type modal, provide the following information:
    • Client Type: Select Backend Server, Machine (M2M), or Native.
    • Client Name: Enter a name to identify the client.
  2. Click Create to create the client.

Figure 5: Select the client type and enter a client name.

  1. If you selected Backend Server or Machine (M2M) as the client type, Wristband displays the newly generated client credentials:
    • Client ID: A unique identifier assigned to the OAuth2 client.
    • Client Secret: A secret used to authenticate the client.
  2. Copy and securely store the client credentials.
  3. Click Configure Client to continue configuring the new client, or Close to return to the client list.

Figure 6: View and copy the newly generated client credentials.

Client Secret Visibility

Client secrets are displayed only when they are initially generated. Wristband stores only a one-way hash of each secret, so the plaintext value cannot be retrieved later.

Make sure to securely store the client secret before closing the modal. If the secret is lost, you'll need to rotate it to generate a new one.

Native Clients Don't Use Client Secrets

Native clients are classified as public OAuth2 clients because they cannot securely store client secrets. Therefore, Wristband does not generate client secrets for Native clients.

Instead, Native clients must use the Authorization Code flow with Proof Key for Code Exchange (PKCE). PKCE protects the authorization code exchange by requiring the client to provide a code_verifier when exchanging an authorization code for tokens at Wristband's Token Endpoint.

Registering Redirect URIs

Backend Server and Native clients must have at least one registered Redirect URI before they can initiate authorization requests through Wristband's Authorize Endpoint. Redirect URIs specify where Wristband can redirect users after authentication.

M2M clients do not require redirect URIs because they authenticate directly with the Token Endpoint using the client_credentials grant type.

See the Configuring Redirect URIs section for more information.

Editing an Existing Client

To edit an existing OAuth2 client:

  1. From the left navigation menu, select OAuth2 Clients.
  2. Locate the client you want to configure in the clients table.
  3. Click the client's name to open its Edit Client page.

Figure 7: Select an existing OAuth2 client to edit its configuration.

Configuring Client Settings

The Client Settings section allows you to configure the following properties:

  • Name: The name used to identify the OAuth2 client. This value must be unique within the application (case-insensitive).
  • Description: An optional description of the client's purpose.

After making any changes, click Save to apply them.

Figure 8: Configure an OAuth2 client's name and description.

Configuring Redirect URIs

Backend Server and Native clients must have at least one registered redirect URI before they can initiate authorization requests through Wristband's Authorize Endpoint.

For more information about redirect URI requirements, validation rules, and tenant subdomain support, see the Registering Redirect URIs documentation.

To register redirect URIs for a client:

  1. Locate the Redirect URIs section.
  2. Click Add to add a new redirect URI.

Figure 9: Add a redirect URI to an OAuth2 client.

  1. Enter the URL of your application's Callback Endpoint in the text field.
  2. Repeat these steps for any additional redirect URIs you want to register.
  3. Click Save to apply your changes.

Figure 10: Configure and save the client's redirect URIs.

Advanced Settings

Expand the Advanced Settings panel to configure additional OAuth2 client settings. The available options depend on the client type.

SettingDescriptionBackend ServerNativeMachine (M2M)
Enable Refresh Token Grant TypeAllows the client to use the refresh_token grant type to obtain new access tokens without requiring users to re-authenticate.✓✓—
Enable Client Credentials Grant TypeAllows the client to authenticate as itself using the client_credentials grant type.✓——
Enable Refresh Token RotationIssues a new refresh token each time the client uses the refresh_token grant type. When disabled, the existing refresh token can be reused until it expires.—✓—
Restrict Time to Complete LoginEnforces a time limit for completing an authentication flow. When disabled, the authorization request does not expire.✓✓—
How Long Should Users Have to Complete LoginSpecifies the maximum time allowed to complete authentication when the login time restriction is enabled. The maximum duration is 60 minutes.✓✓—
Login URLOverrides the application's default Login URL, allowing the client to use its own Login Endpoint.✓✓—

After making any changes, click Save to apply them.

Figure 11: Configure advanced OAuth2 client settings.

For more information about these settings, see the following documentation:

Configuring JWT Settings

The JWT Settings section allows you to configure token expiration settings for an OAuth2 client. The available settings depend on the client type.

SettingDescriptionBackend ServerNativeMachine (M2M)
Access Token ExpirationHow long access tokens remain valid.✓✓✓
ID Token ExpirationHow long ID tokens remain valid.✓✓—
Refresh Token Idle ExpirationMaximum period a refresh token can remain unused before expiring.✓✓—
Refresh Token Absolute ExpirationMaximum lifetime of a refresh token, regardless of usage.✓✓—

Update the desired settings and click Save to apply your changes.

Figure 12: Configure token expiration settings for an OAuth2 client.

JWT Settings for M2M Clients

M2M clients support only Access Token Expiration because they authenticate using the client_credentials grant type, which does not issue ID tokens or refresh tokens.

For more information about default expiration values, configuration limits, and refresh token rotation, see the OAuth2 Clients documentation.

Assigning Roles to a Client

You can assign roles to Backend Server and Machine-to-Macine (M2M) OAuth2 clients to control which operations they are authorized to perform when authenticating using the client_credentials grant type. Native clients do not support the client_credentials grant type and therefore cannot have roles assigned to them.

To assign roles to a client:

  1. Locate the Roles section.
  2. Use the Assigned Roles dropdown to select the roles you want to assign to the client.
  3. Click Save to apply your changes.

Figure 13: Assign roles to an OAuth2 client.

Wristband API Authorization

Wristband APIs enforce authorization using permissions. When an OAuth2 client authenticates using the client_credentials grant type, its assigned roles determine which Wristband APIs it is authorized to access.

To successfully call a Wristband API using a client credentials access token, the client must have roles assigned that grant the permissions required by the API. If the client lacks the necessary permissions, Wristband rejects the request with a 403 Forbidden response.

Validating a Client Secret

You can validate an existing client secret through the Dashboard to confirm whether it is still valid.

To validate a client secret:

  1. On the Edit Client page, locate the Client Secret Settings section.
  2. Enter the secret you want to validate in the Client Secret field.
  3. Click Validate to check whether the secret is valid.

Figure 14: Validate an existing client secret.

Rotating a Client Secret

You can rotate a client secret to generate a new credential without immediately invalidating the existing primary secret. This allows you to update the secret used by your services without interrupting authentication.

To rotate a client secret:

  1. Locate the Client Secret Settings section.
  2. Find the Primary Client Secret field.
  3. Click Rotate.

Figure 15: Rotate the primary client secret.

  1. In the confirmation modal, type rotate to confirm the operation.
  2. Click Rotate to generate a new primary client secret.

Figure 16: Confirm client secret rotation.

  1. Copy and securely store the newly generated primary client secret.
  2. Click Done to close the modal.

Figure 17: Copy the newly generated primary client secret.

When a client secret is rotated:

  • New Primary Secret: Wristband generates a new primary client secret.
  • Previous Primary Secret: The previous primary secret becomes the secondary client secret and remains valid.
  • Existing Secondary Secret: If a secondary secret already exists, it is permanently invalidated and replaced by the previous primary secret.

Existing Secondary Client Secrets

A client can have only one primary and one secondary secret. Rotating the primary secret when a secondary secret already exists permanently invalidates the existing secondary secret.

Ensure that no services are still using the existing secondary secret before performing another rotation.

Deleting a Secondary Client Secret

After updating all services to use the new primary secret, you can delete the secondary secret to prevent the old credential from being used.

To delete a secondary client secret:

  1. Locate the Client Secret Settings section.
  2. Find the Secondary Client Secret field.
  3. Click Delete.

Figure 18: Delete the secondary client secret.

  1. In the confirmation modal, type delete to confirm the operation.
  2. Click Delete to permanently invalidate the secondary client secret.

Figure 19: Confirm deletion of the secondary client secret.

Generating Access Tokens

For clients that have the client_credentials grant enabled, you can generate access tokens directly through the Wristband Dashboard to test authenticated API requests using tools such as cURL or Postman.

To generate an access token:

  1. Locate the Generate Access Tokens section.
  2. Enter the client's secret in the Client Secret field.
  3. Click New Token to generate an access token.

Figure 20: Generate an access token for testing API requests.

  1. Copy the generated access token and store it securely.
  2. Click Done to close the modal.

Figure 21: Copy the newly generated access token.

Supported Client Types

Access tokens can only be generated through the Dashboard for M2M clients or Backend Server clients that have the client_credentials grant type enabled.

The generated access token represents the authenticated OAuth2 client rather than an individual user. Any Wristband API requests made using this token must be authorized by the roles and permissions assigned to the client.

For more information about generating access tokens for testing, see the Getting Access Tokens to Test Wristband APIs documentation.

Deleting a Client

You can permanently delete an OAuth2 client through the Wristband Dashboard.

To delete a client:

  1. Scroll to the bottom of the page and locate the Delete This Client section.
  2. Click Delete.

Figure 22: Delete an existing OAuth2 client.

  1. In the confirmation modal, type delete to confirm the operation.
  2. Click Delete to permanently delete the client.

Figure 23: Confirm permanent deletion of the OAuth2 client.

Permanent Client Deletion

Deleting an OAuth2 client is permanent and cannot be undone. Once deleted, the client can no longer be used to initiate authentication requests or obtain new access tokens.

Ensure that no applications or services are still using the client before deleting it.


Did this page help you?