Skip to main content

Token Formats

OpenID Connect lets you control the cryptographic shape of two outputs: the ID Token and the UserInfo response. ThunderID supports four formats and a curated set of algorithms, picked from the JOSE standards (RFC 7515 JWS, RFC 7516 JWE, RFC 7518 JWA).

The choice trades operational simplicity against confidentiality. JWS gives you integrity. JWE gives you confidentiality. NESTED_JWT gives you both.

Format Matrix

FormatApplies toSignedEncryptedContent-Type
JSONUserInfo onlyapplication/json
JWSID Token (default), UserInfoapplication/jwt
JWEID Token, UserInfoapplication/jwt
NESTED_JWTID Token, UserInfoapplication/jwt

For the ID Token, JWS is the default and the most widely supported. Pick JWE or NESTED_JWT only when the ID Token will traverse an untrusted intermediary that must not read its contents.

For UserInfo, JSON is the default. Switch to JWS when integrity matters; to JWE or NESTED_JWT when confidentiality matters.

Supported Signing Algorithms (JWS)

Applies to JWS and the signing step of NESTED_JWT.

AlgorithmFamilyRecommendation
RS256RSA-PKCS#1 v1.5Widely supported. Strong default.
RS512RSA-PKCS#1 v1.5Stronger hash. Higher CPU.
PS256RSA-PSSProbabilistic RSA. Preferred over RS* for new deployments.
ES256ECDSA P-256Smaller signatures than RSA. Good default for performance-sensitive paths.
ES384ECDSA P-384Larger curve.
ES512ECDSA P-521Largest curve.
EdDSAEd25519Fastest signing and verification. Newest.

Symmetric algorithms (HS256, HS384, HS512) are not supported for token signing.

Supported Encryption Algorithms (JWE)

Applies to JWE and the encryption step of NESTED_JWT.

Key Management (alg)

AlgorithmDescription
RSA-OAEPRSA-OAEP with SHA-1
RSA-OAEP-256RSA-OAEP with SHA-256 (preferred)

Content Encryption (enc)

AlgorithmDescription
A128CBC-HS256AES-128-CBC + HMAC-SHA-256 authentication tag
A256GCMAES-256 in Galois/Counter Mode (preferred when supported)

Token Lifetimes

Access token and ID token lifetimes are configured per application. Both default to 3600 seconds (one hour).

SettingDefaultDescription
token.accessToken.validityPeriod3600Access token lifetime in seconds
token.idToken.validityPeriod3600ID token lifetime in seconds

Refresh tokens are governed separately. See Refresh Token.

Embedded User Attributes

The userAttributes array on each token type controls which user attributes are embedded as claims.

SettingDescription
token.accessToken.userAttributesAttributes embedded in the access token payload. Standard claims (sub, iss, exp, …) are always included and cannot be removed.
token.idToken.userAttributesAttributes embedded in the ID token. Only attributes covered by the requested scopes are returned. See Claims & Scopes.

Certificate Prerequisites

Encrypted responses (JWE, NESTED_JWT) and private_key_jwt client authentication require an OAuth client certificate: either an inline JWKS or a JWKS_URI ThunderID can fetch. See OAuth client certificate for the full rules.

Use caseCertificate required?Reason
JWS ID Token (default)NoThunderID signs with its own key (see JWKS)
JWE / NESTED_JWT ID TokenYesEncrypted to the client's public key
JWS UserInfoNoThunderID signs with its own key
JWE / NESTED_JWT UserInfoYesEncrypted to the client's public key
private_key_jwt client authYesVerifying the client's signed assertion

Try It in ThunderID

  1. Open Applications or Agents in the ThunderID Console and select your client.
  2. Open the Token tab.
  3. Use the ID Token section to configure ID Token format, signing, and encryption.
  4. Use the UserInfo section to configure the UserInfo response format.
  5. For encrypted responses, configure a Certificate in the OAuth client settings.
  6. Save.

Inspect What a Deployment Advertises

The supported algorithms are listed in the Server Metadata document, for example, id_token_signing_alg_values_supported and userinfo_encryption_enc_values_supported.

Explore with AI

ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© Copyright Linux Foundation Europe.For web site terms of use, trademark policy and other project policies please see https://linuxfoundation.eu/en/policies.