Skip to content

Client access tokens

Client access tokens are used to authorize backend API calls to Mosaic services. They are retrieved by calling the /oidc/token endpoint using a client credentials flow (see Get client access tokens), and passed in the Authorization header of API calls to authorize them. This describes the structure and semantics of the client access tokens returned by Mosaic.

Claims

The access token is a JWT (Json Web Token) signed by Mosaic. It contains standard JWT claims, and describes the access context (such as the client/app/tenant for which it was generated, which resources it can access, scope of permissions, etc.).

ClaimDescriptionType
subSubject of the token (client_id)String
issIssuer of the token, which should match the issuer returned from the /oidc/jwks endpoint.String
iatTime the token was issued.Number
expExpiration time, in epoch time format. The token will not be accepted on or after this time.Number
audAudience, which is the intended recipient of the token. If a specific resource is requested, this contains the resource URI. Default is userid-api.String
scopeRequested scopes, as a space delimited stringString
roleContains the Admin role for an admin access token (which are generated using credentials of a Management Application).Array
client_idIdentifer of the client that requested the access.String
app_nameFriendly name of the application that requested the access.String
app_idIdentifer of the application that requested the access.String
tidIdentifer of the tenant that requested the access.String
ts_rolesLists roles assigned to the client.Array
ts_permissionsContains the effective access permissions granted to the client through assigned roles. Any changes to client roles take up to 5 minutes to propagate, meaning that updated permissions will appear in new client access tokens generated no sooner than in 5 minutes after the change was made.Array
cnfContains X.509 certificate thumbprint (SHA-256) as a confirmation of token being bound to a specific certificate (only if token binding is enabled for mTLS or private key JWT authentication). Includes x5t#S256 key and its value.Object

Token example

Here's an example of a decoded client access token:

{
  "tid": "6oi3tjkijshdfgekwjfwey9",
  "app_name": "Acme",
  "app_id": "zl2trg3sanjsd63qs7se",
  "roles": [],
  "jti": "ABCSrjsReaYKk-FSHHZU",
  "sub": "u6jkjhsdf87efbwv57u",
  "iat": 1675590719,
  "exp": 1675594319,
  "scope": "openid offline_access",
  "client_id": "pVEZaxjhbdshcudsLe",
  "iss": "https://userid.security",
  "aud": "userid-api",
  "ts_roles": ["reader"],
  "ts_permissions": ["read:user"]
}