# Manage Software Tokens

Learn about OAuth2 and OpenID Connect Tokens and how they are used.

> For the index of this section of the site, see [llms.txt](https://fusionauth.io/docs/llms.txt)

When using the OAuth2 and OpenID Connect authentication grants you'll be dealing with some tokens. We'll review each token type, the purpose and how to use them.

Here's a presentation discussing how to use JWTs in a microservices architecture:

[Play](https://youtube.com/watch?v=SLc3cTlypwM)

## JWT Structure

With the exception of the refresh token, each token described here is a JSON Web Token (JWT) and each JWT has a header, a payload and a signature. You can [decode JWTs using any number of online tools](https://fusionauth.io/dev-tools/jwt-decoder.md), because it's two base 64 encoded strings joined by periods, with the signature for integrity checking.

![The components of a JWT.](https://fusionauth.io/img/shared/json-web-token.png)

## Header

The following describes the claims found in the JWT header.

`gty`

*   Type: `Array<String>`
*   Available since `1.36.0`
*   Deprecated

The list of grant types in chronological order.

For example, if the token was the result of an `authorization_code` grant, the value will be `[authorization_code]`.

If the token was generated using a refresh token using the `refresh_token` grant, the value will be `[authorization_code, refresh_token]` if the initial grant used to obtain the refresh token was the `authorization_code` grant.

Removed in `1.160.0`

As of version `1.60.0`, this claim is no longer returned in the header. This claim has moved to the JWT body.

`kid`

*   Type: `String`

The unique key identifier that represents the key used to build the signature.

`typ`

*   Type: `String`

The type of token, this value is always `JWT`.

## Access Token

The access token is an opaque token per the OAuth2 specification. In the FusionAuth implementation the access token is a JSON Web Token (JWT).

### Access Token Claims

`applicationId`

*   Type: `UUID`

The unique Id of the Application for which the user has been authenticated. This claim is only present if the user is registered for the application.

`aud`

*   Type: `String`

The audience the JWT is intended for. This registered claim is defined by [RFC 7519 Section 4.1.3](https://tools.ietf.org/html/rfc7519#section-4.1.3).

This claim will be equal to the `client_id`, or, if one or more `resource` values was provided, an array containing both the `client_id` and the list of resources.

`authenticationType`

*   Type: `String`

The method used to authenticate the user that resulted in the generated JWT. The possible values are:

*   `APPLE` - The user was authenticated using Apple. Available since `1.17.0`
*   `APPLICATION_TOKEN` - The user was authenticated using an Application Authentication Token.
*   `EpicGames` - The user was authenticated using Epic Games. Available since `1.28.0`
*   `FACEBOOK` - The user was authenticated using Facebook. Available since `1.1.0`
*   `FEDERATED_JWT` - The user was authenticated using a JWT from an external source.
*   `GENERIC_CONNECTOR` - The user was authenticated using a generic connector. Available since `1.18.0`
*   `GOOGLE` - The user was authenticated using Google. Available since `1.1.0`
*   `HYPR` - The user was authenticated using HYPR. Available since `1.12.0`
*   `JWT_SSO` - A valid JWT associated with one application was exchanged for another JWT associated with a different application.
*   `LDAP_CONNECTOR` - The user was authenticated using an LDAP connector. Available since `1.18.0`
*   `LINKEDIN` - The user was authenticated using LinkedIn. Available since `1.23.0`
*   `Nintendo` - The user was authenticated using Nintendo. Available since `1.36.0`
*   `ONE_TIME_PASSWORD` - The user was authenticated using a one-time password. Available since `1.5.0`
*   `OPENID_CONNECT` - The user was authenticated using OIDC. Available since `1.1.0`
*   `PASSWORD` - The user was authenticated using a loginId and password combination.
*   `PASSWORDLESS` - The user was authenticated using a passwordless login link. Available since `1.5.0`
*   `PING` - The user was authenticated using a `PUT` request on the Login API. This is used to record a login event without prompting for credentials, such as when the FusionAuth SSO session is used.
*   `REFRESH_TOKEN` - The user requested a new JWT using a refresh token.
*   `REGISTRATION` - The user was created using the Registration API. Available since `1.16.0`
*   `SAMLv2` - The user was authenticated using SAMLv2. Available since `1.6.0`
*   `SAMLv2IdpInitiated` - The user was authenticated using SAMLv2 IdP Initiated login. Available since `1.28.0`
*   `SonyPSN` - The user was authenticated using Sony. Available since `1.28.0`
*   `Steam` - The user was authenticated using Steam. Available since `1.28.0`
*   `TWITTER` - The user was authenticated using Twitter. Available since `1.1.0`
*   `Twitch` - The user was authenticated using Twitch. Available since `1.28.0`
*   `USER_CREATE` - The user was created using the User API. Available since `1.16.0`
*   `WebAuthn` - The user was authenticated using a passkey. Available since `1.41.0`
*   `Xbox` - The user was authenticated using Xbox. Available since `1.28.0`

`auth_time`

*   Type: `Long`
*   Available since `1.36.0`

The time of the initial authentication request, expressed as [unix time](https://fusionauth.io/docs/apis/data-types.md#unix-time). The value will not change even if the token is re-issued using a Refresh Token.

`email`

*   Type: `String`

The email address of the user whose claims are represented by this JWT.

Removed in `1.50.0`

In version `1.50.0` and later this claim is not returned when the **oauthConfiguration.scopeHandlingPolicy** value of the Application is `Strict`.

`email_verified`

*   Type: `Boolean`

The verification status of the **email**. This value is `true` when the email is verified.

Removed in `1.50.0`

In version `1.50.0` and later this claim is not returned when the **oauthConfiguration.scopeHandlingPolicy** value of the Application is `Strict`.

`exp`

*   Type: `Long`

The expiration instant of the JWT, expressed as [unix time](https://fusionauth.io/docs/apis/data-types.md#unix-time). This registered claim is defined by [RFC 7519 Section 4.1.4](https://tools.ietf.org/html/rfc7519#section-4.1.4).

`gty`

*   Type: `Array<String>`
*   Available since `1.60.0`

The list of grant types in chronological order.

For example, if the token was the result of an `authorization_code` grant, the value will be `[authorization_code]`.

If the token was generated using a refresh token using the `refresh_token` grant, the value will be `[authorization_code, refresh_token]` if the initial grant used to obtain the refresh token was the `authorization_code` grant.

This claim is will not be present if the token was generated outside of an OAuth grant.

`iat`

*   Type: `Long`

The instant that the JWT was issued, expressed as [unix time](https://fusionauth.io/docs/apis/data-types.md#unix-time). This registered claim is defined by [RFC 7519 Section 4.1.6](https://tools.ietf.org/html/rfc7519#section-4.1.6).

`jti`

*   Type: `String`
*   Available since `1.18.0`

The unique identifier for this JWT. This registered claim is defined by [RFC 7519 Section 4.1.7](https://tools.ietf.org/html/rfc7519#section-4.1.7).

`iss`

*   Type: `String`

The issuer of the JWT. For FusionAuth, this is always the value defined in the tenant JWT configuration. This registered claim is defined by [RFC 7519 Section 4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1).

`preferred_username`

*   Type: `String`
*   Available since `1.5.0`

The username of the user whose claims are represented by this JWT.

Removed in `1.50.0`

In version `1.50.0` and later this claim is not returned when the **oauthConfiguration.scopeHandlingPolicy** value of the Application is `Strict`.

`roles`

*   Type: `Array<String>`

The roles assigned to the user in the authenticated Application. This claim is only present if the user is registered for the Application.

`scope`

*   Type: `String`
*   Available since `1.50.0`

The scope of the Access token. This meaning of this field is specified by [RFC 6749 Section 3.3](https://datatracker.ietf.org/doc/html/rfc6749#section-3.3).

Contains the validated and consented OAuth scopes from the initial authentication request. See [Scopes](https://fusionauth.io/docs/authorization/oauth-scopes.md) for more detail on scope consent.

`sid`

*   Type: `String`
*   Available since `1.37.0`

The unique Id of the refresh token returned along with this access token when the `offline_access` scope was requested. This unique Id is the persistent identifier for this refresh token, and will not change even when using one-time use refresh tokens. This value may optionally be used to revoke the token using the [Refresh Token API](https://fusionauth.io/docs/apis/jwt/revoke-refresh-tokens.md).

`sub`

*   Type: `UUID`

The subject of the token. The value is the unique Id of the FusionAuth user. This registered claim is defined by [RFC 7519 Section 4.1.2](https://tools.ietf.org/html/rfc7519#section-4.1.2).

`tid`

*   Type: `UUID`
*   Available since `1.36.0`

The FusionAuth Tenant unique Id.

`tty`

*   Type: `UUID`
*   Available since `1.60.0`

The token type. This value will always be `at` indicating this is an `access token`.

### Sample Access Token

Here's a sample access token.

```plaintext
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImd0eSI6WyJhdXRob3JpemF0aW9uX2NvZGUiXSwia2lkIjoiWG9xN2tLM2VJWHJ5WW1pNTBaT3ZnMmJjY2VNIn0.eyJhdWQiOiJlOWZkYjk4NS05MTczLTRlMDEtOWQ3My1hYzJkNjBkMWRjOGUiLCJleHAiOjE3MDMwMzcxODAsImlhdCI6MTcwMzAzMzU4MCwiaXNzIjoiYWNtZS5jb20iLCJzdWIiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0xMTExMTExMTExMTEiLCJqdGkiOiIyZTIyNzFkNy0zMDU3LTRiZmQtOTlhYi0zNGFmNDhlODQ1NjciLCJhdXRoZW50aWNhdGlvblR5cGUiOiJQQVNTV09SRCIsImVtYWlsIjoicmljaGFyZEBleGFtcGxlLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJhcHBsaWNhdGlvbklkIjoiZTlmZGI5ODUtOTE3My00ZTAxLTlkNzMtYWMyZDYwZDFkYzhlIiwic2NvcGUiOiJvZmZsaW5lX2FjY2VzcyBwcm9maWxlIG9wZW5pZCIsInJvbGVzIjpbXSwic2lkIjoiMGFiZTcxMzktMGJkMC00ZmQwLWE0NTAtYzFlOGIxNmU3MTBhIiwiYXV0aF90aW1lIjoxNzAzMDMzNTgwLCJ0aWQiOiJkN2QwOTUxMy1hM2Y1LTQwMWMtOTY4NS0zNGFiNmM1NTI0NTMifQ.IyQL-d2BgG0VmfHg2gmge7MgDwYXrMX7xDv5lz-pe0oravlZUAt0B9DhfPaY-EFZ0Dus95dTIVtU4-THYkGNy4Un21FjoTAGU8fZK_Cew16814194WvQDR5wL_cZymog9UmmUv_owKot5YzwLdoJKXVBI7CgM3c43KrwGOdFPMHNkL-YHQgWFQzXBfRpmdu45K56Np8mYVbgVwFKgRXRIGy0PpBGaoeRiN1DfeB3fzR944ddActyOfTVovIXqO7O5HORS8vFQA6h1wpNdAtrbCMqHEVgQWHSMZCkUGM7RlE3V9WepRcaLkpuMocQfxDasoRZCIeK1ZwRHuSbAh7zFA
```

### Validate an Access Token

Your app must validate an access token before trusting any claim in the token. Validation checks the following:

*   The signature matches a key from the FusionAuth [JSON Web Key Set](https://fusionauth.io/docs/apis/oauth/jwks.md).
*   The token hasn't expired.
*   The `iss` claim matches the issuer of your tenant.
*   The `aud` claim matches your application Id.

The following function from an [example app](https://github.com/FusionAuth/fusionauth-example-get-started) reads the access token from an `HttpOnly` cookie and validates the token with the [jose](https://github.com/panva/jose) library. When validation fails because the token expired, the app tries a [refresh token](#refresh-token) before sending the user back to the login page:

```typescript
async getUser(req: Request, res: Response): Promise<JWTPayload> {
  let accessToken = req.cookies[this.configuration.accessTokenCookieName];
  if (!accessToken) {
    return null;
  }

  let payload: JWTPayload;
  try {
    payload = (await jose.jwtVerify(accessToken, this.JWKS, {
      issuer: this.configuration.oauthIssuer,
      audience: this.configuration.applicationId,
    })).payload;
  } catch (e) {
    payload = await this.handleJWTException(req, res, e);
  }

  return payload;
}
```

For where to store tokens in a browser, see [Token Storage](https://fusionauth.io/docs/security/tokens-and-keys/token-storage.md).

## Client Credentials Access Token

The access token is an opaque token per the OAuth2 specification. In the FusionAuth implementation, the credentials access token is a JSON Web Token (JWT).

Available since `1.26`

### Client Credentials Access Token Claims

`aud`

*   Type: `Array<String>`

The audience(s) of this token. This value is equal to the target Entity's unique Id in FusionAuth. This registered claim is defined by [RFC 7519 Section 4.1.3](https://tools.ietf.org/html/rfc7519#section-4.1.3).

Note that prior to version `1.60.0`, this claim was a string when a single entity was defined in the scope using `target-entity:` and an array when more than one entity was defined in the scope. To simplify integrations, this claim is now always returned as an array.

`exp`

*   Type: `Long`

The expiration instant of the JWT expressed as [unix time](https://fusionauth.io/docs/apis/data-types.md#unix-time). This registered claim is defined by [RFC 7519 Section 4.1.4](https://tools.ietf.org/html/rfc7519#section-4.1.4).

`gty`

*   Type: `Array<String>`
*   Available since `1.60.0`

The list of grant types in chronological order.

For example, if the token was the result of an `authorization_code` grant, the value will be `[authorization_code]`.

If the token was generated using a refresh token using the `refresh_token` grant, the value will be `[authorization_code, refresh_token]` if the initial grant used to obtain the refresh token was the `authorization_code` grant.

`iat`

*   Type: `Long`

The instant that the JWT was issued expressed as [unix time](https://fusionauth.io/docs/apis/data-types.md#unix-time). This registered claim is defined by [RFC 7519 Section 4.1.6](https://tools.ietf.org/html/rfc7519#section-4.1.6).

`iss`

*   Type: `String`

The issuer of the JWT. For FusionAuth, this is always the value defined in the tenant JWT configuration. This registered claim is defined by [RFC 7519 Section 4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1).

`jti`

*   Type: `String`

The unique identifier for this JWT. This registered claim is defined by [RFC 7519 Section 4.1.7](https://tools.ietf.org/html/rfc7519#section-4.1.7).

`permissions`

*   Type: `Array<String>`

The permission granted to the recipient Entity by the target Entity. This claim is only present if permissions are associated with the grant and any requested permissions are found in the grant.

`scope`

*   Type: `String`

The scope of the Access token. This meaning of this field is specified by [RFC 6749 Section 3.3](https://datatracker.ietf.org/doc/html/rfc6749#section-3.3) and referenced in Client Credentials Grant [RFC 6749 Section 4.4](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4)

Valid scopes are described in the [client credentials scopes section](https://fusionauth.io/docs/authentication/oauth.md#client-credentials-scopes).

`sub`

*   Type: `UUID`

The subject of the token. The value is the unique Id of the recipient Entity. This registered claim is defined by [RFC 7519 Section 4.1.2](https://tools.ietf.org/html/rfc7519#section-4.1.2).

`tid`

*   Type: `UUID`
*   Available since `1.36.0`

The unique Id of the user's tenant.

`tty`

*   Type: `UUID`
*   Available since `1.60.0`

The token type. This value will always be `at` indicating this is an `access token`.

`use`

*   Type: `String`
*   Available since `1.60.0`

The intended use for this token. This claim will only be present when an access token has been created for use by the FusionAuth SCIM server. When the claim is present the value will be `scim_server`.

## Id Token

The Id Token is part of the OpenID Connect specification. The Id Token is a JSON Web Token (JWT) per the OpenID Connect specification. The Id Token is similar to the access token in the FusionAuth implementation. The Id Token may contain additional claims not present in the Access Token.

The Id Token may be returned as part of an Authentication request when the `openid` scope is requested.

Note

In version `1.50.0` and later the Id Token claims are populated based on the requested OAuth scopes when the **oauthConfiguration.scopeHandlingPolicy** value of the application object is `Strict`.

### Id Token Claims

`applicationId`

*   Type: `UUID`

The unique Id of the Application for which the user has been authenticated. This claim is only present if the user is registered for the application.

Removed in `1.24.0`

As of version `1.24.0`, this claim is no longer returned by default. The `id_token` should not be utilized for authorization, so this claim was removed to make it less likely for a holder of this token to incorrectly utilize this token. If you have a need for this claim, it can be added back using a JWT populate lambda.

`at_hash`

*   Type: `String`
*   Available since `1.5.0`

The Access Token hash value. As defined by the [3.1.3.6 of the OpenID Connect Core specification](https://openid.net/specs/openid-connect-core-1_0.html#CodeIDToken) this value is a base64 encoded hash of the access token.

`aud`

*   Type: `String`

The audience the JWT is intended for. This registered claim is defined by [RFC 7519 Section 4.1.3](https://tools.ietf.org/html/rfc7519#section-4.1.3).

This claim will be equal to the `client_id`, or, if one or more `resource` values was provided, an array containing both the `client_id` and the list of resources.

`authenticationType`

*   Type: `String`

The method used to authenticate the user that resulted in the generated JWT. The possible values are:

*   `APPLE` - The user was authenticated using Apple. Available since `1.17.0`
*   `APPLICATION_TOKEN` - The user was authenticated using an Application Authentication Token.
*   `EpicGames` - The user was authenticated using Epic Games. Available since `1.28.0`
*   `FACEBOOK` - The user was authenticated using Facebook. Available since `1.1.0`
*   `FEDERATED_JWT` - The user was authenticated using a JWT from an external source.
*   `GENERIC_CONNECTOR` - The user was authenticated using a generic connector. Available since `1.18.0`
*   `GOOGLE` - The user was authenticated using Google. Available since `1.1.0`
*   `HYPR` - The user was authenticated using HYPR. Available since `1.12.0`
*   `JWT_SSO` - A valid JWT associated with one application was exchanged for another JWT associated with a different application.
*   `LDAP_CONNECTOR` - The user was authenticated using an LDAP connector. Available since `1.18.0`
*   `LINKEDIN` - The user was authenticated using LinkedIn. Available since `1.23.0`
*   `Nintendo` - The user was authenticated using Nintendo. Available since `1.36.0`
*   `ONE_TIME_PASSWORD` - The user was authenticated using a one-time password. Available since `1.5.0`
*   `OPENID_CONNECT` - The user was authenticated using OIDC. Available since `1.1.0`
*   `PASSWORD` - The user was authenticated using a loginId and password combination.
*   `PASSWORDLESS` - The user was authenticated using a passwordless login link. Available since `1.5.0`
*   `PING` - The user was authenticated using a `PUT` request on the Login API. This is used to record a login event without prompting for credentials, such as when the FusionAuth SSO session is used.
*   `REFRESH_TOKEN` - The user requested a new JWT using a refresh token.
*   `REGISTRATION` - The user was created using the Registration API. Available since `1.16.0`
*   `SAMLv2` - The user was authenticated using SAMLv2. Available since `1.6.0`
*   `SAMLv2IdpInitiated` - The user was authenticated using SAMLv2 IdP Initiated login. Available since `1.28.0`
*   `SonyPSN` - The user was authenticated using Sony. Available since `1.28.0`
*   `Steam` - The user was authenticated using Steam. Available since `1.28.0`
*   `TWITTER` - The user was authenticated using Twitter. Available since `1.1.0`
*   `Twitch` - The user was authenticated using Twitch. Available since `1.28.0`
*   `USER_CREATE` - The user was created using the User API. Available since `1.16.0`
*   `WebAuthn` - The user was authenticated using a passkey. Available since `1.41.0`
*   `Xbox` - The user was authenticated using Xbox. Available since `1.28.0`

`auth_time`

*   Type: `Long`
*   Available since `1.36.0`

The time of the initial authentication request expressed as [unix time](https://fusionauth.io/docs/apis/data-types.md#unix-time). The value will not change even if the token is re-issued using a Refresh Token.

`birthdate`

*   Type: `String`
*   Available since `1.50.0`

The birthDate of the user if available. Format will be in `YYYY-MM-DD` as defined by the OpenID Connect core specification.

When the `Scope handling policy` is `Strict`, this field is only populated when the **scope** claim contains the `profile` scope.

`c_hash`

*   Type: `String`
*   Available since `1.5.0`

The Authorization Code hash value. As defined by the [3.3.2.11 of the OpenID Connect Core specification](https://openid.net/specs/openid-connect-core-1_0.html#HybridIDToken) this value is an encoded hash of the authorization code, the algorithm used to generate this hash depends upon the algorithm used to generate the `id_token` signature.

`email`

*   Type: `String`

The email address of the user whose claims are represented by this JWT.

In version `1.50.0` and later, when the `Scope handling policy` is `Strict`, this field is only populated when the **scope** claim contains the `email` scope.

`email_verified`

*   Type: `Boolean`

The verification status of the **email**. This value is `true` when the email is verified.

In version `1.50.0` and later, when the `Scope handling policy` is `Strict`, this field is only populated when the **scope** claim contains the `email` scope.

`exp`

*   Type: `Long`

The expiration instant of the JWT, expressed as [unix time](https://fusionauth.io/docs/apis/data-types.md#unix-time). This registered claim is defined by [RFC 7519 Section 4.1.4](https://tools.ietf.org/html/rfc7519#section-4.1.4).

`family_name`

*   Type: `String`
*   Available since `1.50.0`

The last name of the user if available.

When the `Scope handling policy` is `Strict`, this field is only populated when the **scope** claim contains the `profile` scope.

`given_name`

*   Type: `String`
*   Available since `1.50.0`

The first name of the user if available.

When the `Scope handling policy` is `Strict`, this field is only populated when the **scope** claim contains the `profile` scope.

`gty`

*   Type: `Array<String>`
*   Available since `1.60.0`

The list of grant types in chronological order.

For example, if the token was the result of an `authorization_code` grant, the value will be `[authorization_code]`.

If the token was generated using a refresh token using the `refresh_token` grant, the value will be `[authorization_code, refresh_token]` if the initial grant used to obtain the refresh token was the `authorization_code` grant.

`iat`

*   Type: `Long`

The instant that the JWT was issued, expressed [unix time](https://fusionauth.io/docs/apis/data-types.md#unix-time). This registered claim is defined by [RFC 7519 Section 4.1.6](https://tools.ietf.org/html/rfc7519#section-4.1.6).

`iss`

*   Type: `String`

The issuer of the JWT. For FusionAuth, this is always the value defined in the tenant JWT configuration. This registered claim is defined by [RFC 7519 Section 4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1).

`jti`

*   Type: `String`
*   Available since `1.18.0`

The unique identifier for this JWT. This registered claim is defined by [RFC 7519 Section 4.1.7](https://tools.ietf.org/html/rfc7519#section-4.1.7).

`middle_name`

*   Type: `String`
*   Available since `1.50.0`

The middle name of the user if available.

When the `Scope handling policy` is `Strict`, this field is only populated when the **scope** claim contains the `profile` scope.

`name`

*   Type: `String`
*   Available since `1.50.0`

The full name of the user if available.

When the `Scope handling policy` is `Strict`, this field is only populated when the **scope** claim contains the `profile` scope.

`nonce`

*   Type: `String`
*   Available since `1.5.0`

`phone_number`

*   Type: `String`
*   Available since `1.50.0`

The phone number of the user if available. (**user.phoneNumber** or **user.mobilePhone** will be used in this order of precedence).

This field is only populated when the `Scope handling policy` is `Strict`, and the **scope** claim contains the `phone` scope.

`phone_number_verified`

*   Type: `Boolean`
*   Available since `1.59.0`

The verification status of the **phone\_number**. This value is `true` when the phone number is verified.

This claim is based only on the **user.phoneNumber** verification status.

This field is only populated when the `Scope handling policy` is `Strict`, and the **scope** claim contains the `phone` scope.

`picture`

*   Type: `String`
*   Available since `1.50.0`

A URL to a picture of the user if available.

When the `Scope handling policy` is `Strict`, this field is only populated when the **scope** claim contains the `profile` scope.

`preferred_username`

*   Type: `String`
*   Available since `1.5.0`

The username of the user whose claims are represented by this JWT.

In version `1.50.0` and later, when the `Scope handling policy` is `Strict`, this field is only populated when the **scope** claim contains the `profile` scope.

`roles`

*   Type: `Array<String>`
*   Deprecated

The roles assigned to the user in the authenticated Application. This claim is only present if the user is registered for the application.

Removed in `1.24.0`

As of version `1.24.0`, this claim is no longer returned by default. The `id_token` should not be utilized for authorization, so this claim was removed to make it less likely for a holder of this token to incorrectly utilize this token. If you have a need for this claim, it can be added back using a JWT populate lambda.

`scope`

*   Type: `String`
*   Available since `1.50.0`

The scope of the Id Token. This meaning of this field is specified by [RFC 6749 Section 3.3](https://datatracker.ietf.org/doc/html/rfc6749#section-3.3).

Contains the validated and consented OAuth scopes from the initial authentication request. See [Scopes](https://fusionauth.io/docs/authorization/oauth-scopes.md) for more detail on scope consent.

`sid`

*   Type: `String`

The SSO session Id. This claim will only be present when this token is produced using an interactive grant during a single-signon request such as the Authorization Code grant or the `Implicit` grant.

`sub`

*   Type: `UUID`

The subject of the token. The value is the unique Id of the FusionAuth user. This registered claim is defined by [RFC 7519 Section 4.1.2](https://tools.ietf.org/html/rfc7519#section-4.1.2).

`tid`

*   Type: `UUID`
*   Available since `1.36.0`

The unique Id of the user's tenant.

`tty`

*   Type: `UUID`
*   Available since `1.60.0`

The token type. This value will always be `idt` indicating this is an `id_token`.

### Sample Id Token

Here's a sample Id token.

```plaintext
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImd0eSI6WyJhdXRob3JpemF0aW9uX2NvZGUiXSwia2lkIjoiWG9xN2tLM2VJWHJ5WW1pNTBaT3ZnMmJjY2VNIn0.eyJhdWQiOiJlOWZkYjk4NS05MTczLTRlMDEtOWQ3My1hYzJkNjBkMWRjOGUiLCJleHAiOjE3MDMwMzcxODAsImlhdCI6MTcwMzAzMzU4MCwiaXNzIjoiYWNtZS5jb20iLCJzdWIiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0xMTExMTExMTExMTEiLCJqdGkiOiIyOWVkMjA5NC1jOWIxLTRmMGQtODc4Mi00YTc2NWI4YTZmOTIiLCJhdXRoZW50aWNhdGlvblR5cGUiOiJQQVNTV09SRCIsImVtYWlsIjoicmljaGFyZEBleGFtcGxlLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJhdF9oYXNoIjoiZmtqUzc4YjhCbXRlM2lRRVBIRUk2ZyIsImNfaGFzaCI6ImlrT3lkdmljUHRqNU9HMm5zcExtOFEiLCJzY29wZSI6Im9mZmxpbmVfYWNjZXNzIHByb2ZpbGUgb3BlbmlkIiwic2lkIjoiNjlhOTQ4OTYtNjg3ZS00MDQ5LTkwZGItMTY0ZDYwYWVmN2I2IiwiYXV0aF90aW1lIjoxNzAzMDMzNTgwLCJ0aWQiOiJkN2QwOTUxMy1hM2Y1LTQwMWMtOTY4NS0zNGFiNmM1NTI0NTMifQ.rT7Q39-RFT63aw996v0zu2vwS-RIYRvTccmEi_rGV19aKnRnlZD7Bx_dJaaoZxyvD3xfO1wVA2aO_nHQmKhwLuFIt4Jae0Z4a3nlJLKaumCxh4yB4vjAvKAwvhClwWYhx1LbbMl0lvVy-qvs-niVTgPLTVMYnSFXnfTuN8LMDCf7keP3SjS1MTyEeG2WtZzvPd6j2zu66rl5y3uCfpqaLbR0URDsJjQE4GbUMf7UODhZ1_ztGXg_-vGKvpomGB0-0vUmcrqXENtXRFy9hPYHXGp4T-uAy93DUo7AvsrECAHryWq6wzbLIXXeMcCpjWl87Cqb0TwMyM5D30VH2crlLQ
```

## Refresh Token

The refresh token is an opaque token that is used to "refresh", or obtain a new access token. Because the life of an access token is generally measured in minutes, the Refresh Token is by comparison a long lived token that can be used to maintain access to a protected resource.

A refresh token is associated with the same set of validated and consented OAuth scopes from the initial authentication request. The [Refresh Token Grant Request](https://fusionauth.io/docs/apis/oauth/token.md#refresh-token-grant-request) can include a subset of the original scopes to request a new token with a narrower scope.

To request a refresh token during authentication you must provide the `offline_access` scope. The refresh token is not supported by the Implicit Grant, so if you provide the `offline_access` scope during an Implicit Grant workflow it will be ignored.

If you request the `offline_access` scope and an Refresh Token is not returned, ensure that the FusionAuth application has been configured to generate refresh tokens. Ensure `Generate refresh tokens` is enabled in your application settings. See Settings -> Applications -> OAuth . This setting will cause a Refresh Token to be returned when the `offline_access` scope is requested. You will also want to ensure the `Refresh Token` grant is enabled which allows the use of the Refresh Token to be exchanged for a new Access Token.

### Sample Refresh Token

Here's a sample refresh token.

```plaintext
ze9fi6Y9sMSf3yWp3aaO2w7AMav2MFdiMIi2GObrAi-i3248oo0jTQ
```

Related

[Authentication JSON Web Tokens Learn how FusionAuth provides and manages JSON Web Tokens. access tokenrefresh tokenid token](https://fusionauth.io/docs/authentication/login-api/json-web-tokens.md)

[Security Token Storage Learn how to secure tokens generated by FusionAuth. access tokenrefresh tokenid token](https://fusionauth.io/docs/security/tokens-and-keys/token-storage.md)

[APIs JWTs & Refresh Token API Learn about the APIs that allow you to manage Refresh Tokens, verify Access Tokens and retrieve public keys used for verifying JWT signatures. access tokenrefresh token](https://fusionauth.io/docs/apis/jwt.md)

[Dev Tools JWT Decoder Learn how JWT refresh tokens work and how to use them to authenticate and authorize your APIs. access tokenrefresh token](https://fusionauth.io/docs/dev-tools/jwt-decoder.md)
---

## Other pages in OAuth

> For the full index of this section, see [Authentication](https://fusionauth.io/docs/llms-authentication.txt).

- [CIMD Registration Caching And Lifecycle](https://fusionauth.io/docs/authentication/oauth/cimd-registration-lifecycle.md): Learn how long FusionAuth caches a Client ID Metadata Document, what happens when it expires, and how a CIMD client registration is refreshed or removed.
- [OAuth Client Registration | Static and CIMD](https://fusionauth.io/docs/authentication/oauth/client-registration.md): Learn how FusionAuth registers OAuth clients, either ahead of time as Applications or just-in-time from a Client ID Metadata Document.
- [OAuth DPoP](https://fusionauth.io/docs/authentication/oauth/dpop.md): Learn how to enable sender-constrained OAuth tokens DPoP (Demonstration of Proof-of-Possession) with FusionAuth and validate DPoP proofs in your APIs.
- [Host A Client ID Metadata Document (CIMD)](https://fusionauth.io/docs/authentication/oauth/host-cimd-document.md): Publish a Client ID Metadata Document so your OAuth client can log in to FusionAuth without being registered ahead of time.
- [OAuth](https://fusionauth.io/docs/authentication/oauth.md): Learn about the OAuth 2.0 and OpenID Connect grants FusionAuth supports for login and single sign-on.
- [OAuth Issuer Validation](https://fusionauth.io/docs/authentication/oauth/issuer-validation.md): Learn how to validate the authorization response issuer parameter (RFC 9207) to prevent mix-up attacks.
- [Connect claude.ai And chatgpt.com To A FusionAuth-Protected MCP Server](https://fusionauth.io/docs/authentication/oauth/mcp-clients-claude-chatgpt.md): Learn how to connect claude.ai and chatgpt.com to an MCP server protected by FusionAuth using Client ID Metadata Documents.
- [Modes](https://fusionauth.io/docs/authentication/oauth/modes.md): Learn about the eight common ways apps use OAuth and OpenID Connect.
- [OIDC Prompt](https://fusionauth.io/docs/authentication/oauth/prompt.md): Learn about OpenID Connect prompt and example use cases.
- [OAuth Response Modes](https://fusionauth.io/docs/authentication/oauth/response-modes.md): Learn about OAuth 2.0 response modes (query, fragment, form_post) and when to use each one.
- [URL Validation](https://fusionauth.io/docs/authentication/oauth/url-validation.md): Learn about OAuth URL validation policies in FusionAuth.
