name
that asserts that the name of the user authenticating is “John Doe”.
There are two types of JWT claims:
organization
parameter is added to a call to the /authorize
endpoint. Examples of tokens returned when a user logs in through organizations are provided below.
org_id
and org_name
claims. To learn more, review Use Organization Names in Authentication API.https://marketplace/roles
and https://namespace.exampleco.com/
are custom claims that have been added to the token, while the other included claims are standard.
organization
parameter is added to the Client Credentials request to the /oauth/token
endpoint so that an application can obtain an access token for itself rather than a user.
org_id
and org_name
claims. To learn more, read Use Organization Names in the Authentication API.organization
parameter is added to a call to the /authorize
endpoint or the /oauth/token
endpoint, Auth0 SDKs automatically validate the org_id
claim, which is returned as part of any generated tokens. However, for security purposes, additional validation should be performed when tokens are received.
org_id
and org_name
claims. If present, validate the org_name
claim in addition to org_id
to ensure the received values correspond to a trusted entity.In general, using organization IDs is the preferred method for validating tokens. However, organization names can be used if they are more appropriate for your use case. To understand the potential implications of using organization names to validate tokens, review Use Organization Names in Authentication API.organization
parameter was passed to the /authorize
endpoint, but an org_id
claim is present in the , then your application should validate the claim to ensure that the value received is expected or known and that it corresponds to an entity your application trusts, such as a paying customer. If the claim cannot be validated, then the application should deem the token invalid.
For APIs:
If an org_id
claim is present in the access token, then your API should validate the claim to ensure that the value received is expected or known and that it corresponds to an entity your application trusts, such as a paying customer. If the claim cannot be validated, then the API should deem the token invalid.
In particular:
iss
(issuer) claim should be checked to ensure the token was issued by Auth0.org_id
claim should be checked to ensure it is a value that is already known to the application. This could be validated against a known list of organization IDs, or perhaps checked in conjunction with the current request URL. For example, the subdomain may hint at which organization should be used when validating the ID Token.org_id
. This ensures that only information about a given organization can be accessed or modified when the org_id
value corresponding to that organization is received in the access token.