Sessions

Learn how Wristband authentication sessions are used to persist a user's authenticated state.

Overview

A Wristband authentication session allows a user to remain signed in to a specific tenant without entering their credentials each time they initiate an authorization request.

After a user successfully authenticates, Wristband creates an authentication session and stores it in a browser cookie scoped to the tenant domain used for authentication. When the browser subsequently calls Wristband's Authorize Endpoint, Wristband checks for a valid session. If one exists, Wristband can continue the authorization flow without prompting the user to sign in again.

Authentication Sessions vs. Application Sessions

A Wristband authentication session is separate from the session your application uses to keep users signed in.

Wristband manages authentication sessions to remember when users have authenticated within a tenant, allowing them to complete subsequent authorization requests without logging in again.

Your application is responsible for managing its own sessions to maintain authenticated access to its resources. These sessions are independent and can have different expiration policies. Ending or expiring a Wristband authentication session does not automatically terminate an existing application session.

Refer to the guides below for details on how to implement sessions for your application:

Creating an Authentication Session

Wristband creates an authentication session when a user successfully completes one of the following authentication workflows:

  • Login
  • Signup: When email verification is configured as the verification step.
  • User Activation
  • New User Invitation
  • Existing User Invitation
  • Password Reset: When the Immediate Login workflow policy is enabled.

Authentication sessions are scoped to individual tenants and maintained using cookies associated with each tenant's vanity domain. This allows users to authenticate with multiple tenants simultaneously, with each tenant maintaining its own independent authentication session. As a result, users can remain logged in to multiple tenants without one tenant's session interfering with another.

Authentication Session Expiration

Wristband provides two settings that determine how long an authentication session remains valid:

SettingDescriptionMaximum
Idle Expiration TimeExpires the session when it has not been used to make a request to the Authorize Endpoint within the configured period. Each authorization request with a valid session resets the idle expiration window.90 days
Absolute Expiration TimeSets the maximum lifetime of a session, regardless of how frequently it is used.365 days

When either limit is reached, the session expires. The user must authenticate again the next time they initiate an authorization request.

What Resets the Idle Expiration Timer?

Wristband resets a session's idle expiration timer when the browser makes a request to the Authorize Endpoint using a valid authentication session.

Other activity, such as calling your application's APIs or refreshing access tokens, does not reset the authentication session's idle timer. Activity also cannot extend the session beyond its absolute expiration time.

Controlling Reauthentication

By default, when an authorization request includes a valid authentication session cookie, Wristband automatically authenticates the user without requiring them to re-enter their credentials. However, you can control when users must reauthenticate using the prompt and max_age parameters of the Authorize Endpoint.

Using the prompt Parameter

The prompt parameter controls whether Wristband can reuse an existing authentication session or require the user to authenticate again.

prompt ValueBehavior
OmittedReuses an existing valid authentication session without requiring the user to log in again. If no valid session exists, Wristband displays the login page.
loginRequires the user to authenticate again, even if a valid authentication session exists.
noneAttempts to complete authentication without user interaction. If authentication cannot be completed silently, Wristband returns an error, such as login_required.

Using the max_age Parameter

The max_age parameter specifies the maximum time, in seconds, that may have elapsed since the user last authenticated.

For example, max_age=3600 requires the user to authenticate again if more than one hour has passed since their last authentication, even when their authentication session is still valid.

Authentication Session Policies

Authentication session policies control how long Wristband authentication sessions remain valid and whether session cookies persist after the browser is closed.

The following settings are available:

SettingDescription
Idle ExpirationThe maximum amount of time a session can remain inactive before expiring.
Absolute ExpirationThe maximum lifetime of a session, regardless of user activity.
Cookie PersistenceDetermines whether the authentication session cookie persists after the browser is closed or expires when the browser session ends.

Configuring Authentication Session Policies

To configure application-level authentication session policies:

  1. From the Dashboard Home page, select the application you want to configure.
  2. In Application View, navigate to Security → Auth Session Policies.
  3. Configure the authentication session settings described above.
  4. Click Save to apply your changes.

Figure 1: Configure application-level authentication session policies.

Tenant-Level Overrides

By default, tenants inherit the application's authentication session policies. You can enable a tenant-level override to configure different session policies for a specific tenant without affecting other tenants.

To configure a tenant-level authentication session policy override:

  1. From the Dashboard Home page, select the application containing the tenant.
  2. Select the tenant from the tenant dropdown to switch to Tenant View.
  3. From the left navigation menu, select Security → Auth Session Policies.
  4. Select the Edit Tenant Config tab.
  5. Configure the tenant-specific authentication session policies and click Save to save your changes.

Figure 2: Configure tenant-specific authentication session policies.

  1. Enable the Enable this tenant override? toggle to apply the tenant-specific authentication session policies.

Figure 3: Enable the tenant-level authentication session policy override.

To view the authentication session policies currently applied to the tenant, select the Values in Effect tab. The Tenant override badge indicates that the tenant-specific policies are overriding the application-level configuration.

Figure 4: View the authentication session policies currently in effect for a tenant.



Did this page help you?