Token-Based App API Flow

After the user is authenticated via SSO, the mobile app uses access and refresh tokens issued by the Auth Server to interact securely with backend services. This section explains how these tokens are generated, validated, and refreshed across service calls.

This flow assumes that the mobile app interacts with one or more backend services behind a common authentication layer.

What Happens at Login

  1. Once the user logs in, the Auth Server generates both an access token and a refresh token, which are stored in the Users Table and also sent to the mobile app.
  2. Both tokens are formatted as JWTs (JSON Web Tokens).
  3. The access token is short-lived (default: 15 minutes, configurable).
  4. The refresh token has a longer lifespan (default: 30 days, configurable).
  5. Tokens are signed using asymmetric encryption:
    • The Auth Server holds the Private Key used to sign tokens.
    • All other backend services use the Public Key to verify access tokens.