Skip to main content
Docs

Session tokens

When a user is authenticated in your application, Clerk generates a short-lived session token that you can use to authenticate requests to your backend. This token is a JSON Web Token (JWT) that contains information about the user and their session.

Read more about Clerk session tokens and how they work in the guide on how Clerk works.

Default claims

Important

You are reading about version 2 of Clerk's session token claims. To read about version 1, select the respective tab above.

Every generated token has default claims that cannot be overridden by templates. Clerk's default claims include:

ClaimAbbreviation expandedDescriptionExample
azpauthorized partyThe Origin header that was included in the original Frontend API request made from the user. Most commonly, it will be the URL of the application. This claim could be omitted if, for privacy-related reasons, Origin is empty or null.https://example.com
expexpiration timeThe time after which the token will expire, as a Unix timestamp. Determined using the Token lifetime JWT template setting in the Clerk Dashboard. See RFC 7519 for more information.1713158400
fvafactor verification ageEach item represents the minutes that have passed since the last time a first or second factor, respectively, was verified.[7, -1] which means it has been 7 minutes since the first factor was verified, and there either is not a second factor or the second factor has never been verified.
iatissued atThe time at which the token was issued as a Unix timestamp. See RFC 7519 for more information.1713158400
ississuerThe Frontend API URL of your instance. See RFC 7519 for more information.https://clerk.your-site.com for a production instance, https://your-site.clerk.accounts.dev for a development instance
nbfnot beforeThe time before which the token is considered invalid, as a Unix timestamp. Determined using the Allowed Clock Skew JWT template setting in the Clerk Dashboard. See RFC 7519 for more information.1713158400
sidsession IDThe ID of the current session.sess_123
subsubjectThe ID of the current user of the session. See RFC 7519 for more information.user_123
vversionThe version number of the session token.2
feafeaturesA list of enabled features and their scope. The scope can either be o for org-level features, u for user-level features, or uo for both.o:dashboard,o:impersonation

The o claim, or organization claim, is only included if the user is part of an organization and that organization is active. Its value is an object that contains the following properties:

ClaimAbbreviation expandedDescriptionExample
idIDThe ID of the organization.org_123
slgslugThe slug of the organization.org-slug
rolroleThe role of the user in the organization, without the org: prefix.admin
perpermissionsThe names of the permissions the user has in the organization.read,manage
fpmfeature-permission mapThe mapping of features with permissions, where the value of the integer, when converted to binary, represents a bitmask where each bit's position corresponds to a permission in the o.per list, and where 0 = not-allowed and 1 = allowed.3,2

Warning

The organization claims above are intentionally designed to be as compact as possible to keep JWT tokens small. As a result, they can be difficult to decode manually. We strongly recommend using one of our SDKs that support API version 2025-04-10 to handle decoding reliably.

The act (actor) claim is only included if the user is impersonating another user. It's value is an object that contains the following properties:

ClaimAbbreviation expandedDescriptionExample
ississuerThe referrer of the token.https://dashboard.clerk.com
sidsession IDThe session ID of the impersonated session.sess_456
subsubjectThe ID of the impersonator.user_456

Important

Version 1 was deprecated on April 14, 2025. To upgrade to version 2, go to the Updates page in the Clerk Dashboard.

Every generated token has default claims that cannot be overridden by templates. Clerk's default claims include:

ClaimAbbreviation expandedDescriptionExample
azpauthorized partyThe Origin header that was included in the original Frontend API request made from the user. Most commonly, it will be the URL of the application. This claim could be omitted if, for privacy-related reasons, Origin is empty or null.https://example.com
expexpiration timeThe time after which the token will expire, as a Unix timestamp. Determined using the Token lifetime JWT template setting in the Clerk Dashboard. See RFC 7519 for more information.1713158400
fvafactor verification ageEach item represents the minutes that have passed since the last time a first or second factor, respectively, was verified.[7, -1] which means it has been 7 minutes since the first factor was verified, and there either is not a second factor or the second factor has never been verified.
iatissued atThe time at which the token was issued as a Unix timestamp. See RFC 7519 for more information.1713158400
ississuerThe Frontend API URL of your instance. See RFC 7519 for more information.https://clerk.your-site.com for a production instance, https://your-site.clerk.accounts.dev for a development instance
nbfnot beforeThe time before which the token is considered invalid, as a Unix timestamp. Determined using the Allowed Clock Skew JWT template setting in the Clerk Dashboard. See RFC 7519 for more information.1713158400
sidsession IDThe ID of the current session.sess_123
subsubjectThe ID of the current user of the session. See RFC 7519 for more information.user_123

The following claims are only included if the user is part of an organization and that organization is active:

ClaimAbbreviation expandedDescriptionExample
org_idorganization IDThe ID of the active organization that the user belongs to.org_123
org_permissionsorganization permissionsThe permissions of the user in the currently active organization. System permissions are not included in the session token.["org:admin:example_permission", "org:member:example_permission"]
org_slugorganization slugThe slug of the currently active organization that the user belongs to.org-slug
org_roleorganization roleThe role of the user in the currently active organization.org:admin

The act (actor) claim is only included if the user is impersonating another user. It's value is an object that contains the following properties:

ClaimAbbreviation expandedDescriptionExample
ississuerThe referrer of the token.https://dashboard.clerk.com
sidsession IDThe session ID of the impersonated session.sess_456
subsubjectThe ID of the impersonator.user_456

If you would like to add custom claims to your session token, you can customize it.

You can also create custom tokens using a JWT template.

Size limitations

The Clerk session token is stored in a cookie. All modern browsers limit the maximum size of a cookie to 4kb. Exceeding this limit can have adverse effects, including a possible infinite redirect loop for users who exceed this size in Next.js applications.

A session token with the default session claims won't run into this issue, as this configuration produces a cookie significantly smaller than 4kb. However, this limitation becomes relevant when implementing a custom session token. In this case, it's recommended to move particularly large claims out of the token and fetch these using a separate API call from your backend.

Claims to monitor for size limits:

  • user.organizations
  • user.public_metadata
  • user.unsafe_metadata
  • org.public_metadata
  • org_membership.public_metadata

If you include any of these claims in your token, use caution to ensure the stored data doesn't exceed the size limit.

Note

If your application encounters this issue, the Clerk Dashboard will display a warning: "Some users are exceeding cookie size limits". To resolve this, update your custom session token.

Validate session tokens

If you're using the middleware provided by our Clerk SDKs, validating session tokens is handled automatically in every request. If you're not using the middleware, you can still use the respective helpers provided by the SDKs to validate the tokens.

To learn how to manually verify a session token, refer to the dedicated guide.

Feedback

What did you think of this content?

Last updated on