Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device.
Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
This profile configuration was introduced in V3.1 of this plugin. In older releases, it was implicitly part of the OIDC.SSO profile configuration and was not a separate feature.
File(s):conf/relying-party.xml, conf/oidc.properties Format: Native Spring, Spring Properties
The OAUTH2.Token profile configuration bean enables support for the OAUTH 2 Token endpoint, which implements the flow that supports OAuth token granting use cases, including OIDC-specific grant features in support of that particular use case.
In V3.1+ of the plugin, the behavior of the Authorization and Token endpoints has been optionally split into separate profile configurations, in order to support additional OAuth use cases specific to the token endpoint and to allow for more configuration flexibility. When this profile bean is absent, the presence of the OIDC.SSO profile configuration bean implies the OIDC-specific functionality of this endpoint is active with the settings configured on that bean. When present, it supersedes that behavior and directly configures all uses of the endpoint.
Configuration
The most typical options used are described in more detail below, but not every obscure option is discussed. See the javadoc for all of the possible configuration options for this profile (note that some of them are inherited from parent classes).
Virtually all the configuration options below can be set via two different properties: a static property that explicitly sets the value to use and a lookup strategy or predicate property that takes a Function or Predicate and returns the value to use. The dynamic property is generally named "propertyNamePredicate" or "propertyNameLookupStrategy" for Boolean- and non-Boolean-valued properties respectively.
Bean named shibboleth.oidc.DefaultSecurityConfiguration
An object containing all of the default security-related objects needed for peer authentication and encryption. See OIDCSecurityConfiguration for complete details.
specify an alternate signing or decryption key to use
control signing or encryption algorithms
The two interceptor lists allow the much less commonly used profile interceptor injection points to be used. This is largely a Java-based way of doing very low-level sorts of “message rewriting” hackery that might otherwise be impossible to pull off. One use case for the inbound side might be picking up non-standard parameters in a request.
Options common to OP profiles with OIDC flow settings:
Name
Type
Default
Description
Name
Type
Default
Description
authorizationCodeFlowEnabled
Boolean
true
Whether to enable the authorization code flow
hybridFlowEnabled
Boolean
true
Whether to enable the hybrid flow
implicitFlowEnabled
Boolean
true
Whether to enable the implicit flow
refreshTokensEnabled
Boolean
true
Whether to enable refresh token support
Options common to OP profiles that support client authentication:
Enabled endpoint client authentication methods for the profile. Note that the RP metadata also needs to set the token endpoint authentication method: the default value when it’s not set is client_secret_basic.
Also note that the method none for public clients that cannot authenticate is not included in the list of default values. Similarly to other methods, it needs to be enabled in the profile with this option and also set in the RP metadata.
useTargetedEndpointAsJWTAudience4.3
Boolean
true
Flag to enable use of endpoints (the token or target endpoint) in the JWT client authentication audience
requireSingleJWTAudience4.3
Boolean
false
Flag to require single value in the JWT client authentication audience
clientAuthenticationJWTType4.3
String
Mandatory value for the typ header used within JWT authentication
Any custom bean for validating the audience can be set via idp.oauth2.jwtAuth.audienceValidator -property.
For convenience, the enabled client authentication methods are also controllable globally via the idp.oidc.tokenEndpointAuthMethods property.
The DPoP proof validation in the token endpoint is activated whenever any of the following conditions is true:
The incoming request contains a DPoP proof JWT
The use of DPoP proofs is required in the profile configuration (see requireDpopProof)
The RP metadata enforces the use of DPoP tokens (dpop_bound_access_tokens=true)
The valid DPoP proof means that the access token issued by this profile are DPoP tokens. This is signaled in the token type parameter in the response. The alwaysIssueBearerAccessToken option may be used to enforce the issuance of bearer access tokens. Public clients may want to solely bind the refresh tokens with the DPoP public key.
Options related to DPoP proof validation:
Name
Type
Default
Description
Name
Type
Default
Description
requireDpopProof 4.2
Boolean
false
A flag for requiring the DPoP proof JWT in the profile. If the proof exists in the request, it’s always validated.
dpopProofClaimsValidator 4.2
ClaimsValidator
Beans named DefaultDPoPProofClaimsValidator for PAR/token and DefaultDPoPWithAthProofClaimsValidator for others (involving access token validation)
The claims validation configuration used for validating the payload contents of the DPoP proof JWTs. The default values follows the RFC: the latter also verifying the access token hash claim.
dpopProofSignatureValidationConfiguration 4.2
BasicSignatureValidationConfiguration
Bean named DPoPSignatureValidationConfiguration
The bean used for defining the signature validation configuration used for validating DPoP proof signatures.
dpopProofNonceGenerator 4.2
Function< ProfileRequestContext, String>
Bean named DefaultOAuth2DPoPNonceGenerator
The bean used for defining the function used for generating nonce used within DPoP proofs. Null value (#{null}) means that nonces are disabled.
If modified to a non-null value, the dpopProofClaimsValidatorneeds to be modified to be able to validate the custom nonce value.
DPoP proof claims set validation
The idp.policy.messageLifetimeand idp.policy.clockSkew properties are exploited when validating the iat -claim.
The lifetime for the replay cache record is taken from the exp -claim if it exists in the DPoP proof claims set. If not, the property idp.oauth2.dpop.replayCacheLifetime(defaults to 5 minutes) is exploited. The record key is taken from the jti claim.
In order to guard against memory exhaustion attacks, the jti values longer than 64 characters are hashed with SHA-256 before using them as the replay record key. The maximum record lifetime may also be set via idp.oauth2.dpop.maxReplayCacheLifetime-property, which defaults to 5 minutes.
Nonces
If the dpopProofNonceGenerator option has a value, the bean is used for generating nonce values to be used within DPoP proof JWTs. The default value points to an implementation that generates relying party -specific values that are valid for 5 minutes, customisable via idp.oauth2.dpop.nonceLifetime-property. The default implementation exploits the data sealer for encrypting the nonce value into an opaque string.
The default value for dpopProofClaimsValidator contains a claims validator that is activated whenever dpopProofNonceGenerator option has a value.
Note that any browser-based client applications using CORS may require the DPoP-Nonce to be included in the Access-Control-Expose-Headers response header list value. The page https://shibboleth.atlassian.net/wiki/spaces/IDP5/pages/3199501090 describes some alternatives for handling CORS preflight requests. For instance the Spring CORS configuration supports p:exposedHeaders="DPoP-Nonce"as a way for satisfying that requirement.
Options specific to generic or OAuth usage of the Token flow:
Name
Type
Default
Description
Name
Type
Default
Description
resolveAttributes
Boolean
true
Whether to resolve attributes during the token issuance process
grantTypes
Collection<String>
authorization_code, refresh_token
OAuth grant types to allow
accessTokenLifetime
Duration
PT10M
Lifetime of access token issued to client
If you customize this, make sure to set the revocation cache lifetime (See Replay and Revocation section later at this page) to at least this length of time. Also check refreshTokenTimeout and use whichever is longer.
refreshTokenLifetime
Duration
PT2H
Lifetime of refresh token issued to client (Deprecated since 3.4)
refreshTokenTimeout 3.4
Duration
PT2H
Lifetime of a single refresh token issued to client
If you customize this, make sure to set the revocation cache lifetime (See Replay and Revocation section later at this page) to at least this length of time. Also check accessTokenLifetime and use whichever is longer.
refreshTokenChainLifetime 3.4
Duration
PT2H
Lifetime of the chain of refresh tokens issued to client. The expiration instant is calculated by adding the lifetime to the end-user authentication instant.
forcePKCE
Boolean
false
Whether client is required to use PKCE
allowPKCEPlain
Boolean
false
Whether client is allowed to use PKCE code challenge method "plain"
accessTokenType 3.2
String
Format of access token. Supported values are “JWT” or nothing/empty/null, implying opaque tokens.
refreshTokenType 4.1
String
Format of refresh token. Supported values are “JWT” or nothing/empty/null, implying opaque tokens.
enforceRefreshTokenRotation 3.2
Boolean
false
Whether to enforce refresh token rotation. If enabled, the refresh token is revoked whenever it is used for issuing a new refresh token.
strictScopeValidation 4.2
Boolean
false
Whether to enable strict scope validation. If enabled, the request containing non-allowed (not registered for the registered clients or non-policy compliant for unregistered clients) scope values is considered as an error.
alwaysIssueBearerAccessToken 4.2
Boolean
false
Whether to issue bearer token even if the DPoP proof JWT was included in the request. With the public clients, this means that solely the refresh tokens will be bound to the DPoP proof’s public key.
Manipulation strategy for customising access token claims set contents. The BiFunction inputs are the ProfileRequestContext and the current contents of the claims set as a Map<String,Object>.
If the result is non-null, the result (Map<String,Object) is used to replace the contents of the claims set. It is the deployer’s responsibility to ensure the results remain valid/appropriate.
customRedirectUriValidationStrategy 4.2
BiPredicate<
URI,
ProfileRequestContext
>
null
Custom validation strategy for the redirect_uri parameter. If a value is set, it overrides the default validation logic for both registered and unregistered clients.
The following properties can be used to globally adjust some of the settings above (some of them affect other profiles as well).
idp.oauth2.grantTypes
idp.oidc.accessToken.defaultLifetime
idp.oidc.refreshToken.defaultLifetime (deprecated since v3.4)
Options specific to the use of OIDC with the Token flow (in addition to the OAuth settings above):
Name
Type
Default
Description
Name
Type
Default
Description
encryptionOptional
Boolean
true
Whether the absence of encryption details in a client’s metadata should fail when issuing an ID token
iDTokenLifetime
Duration
PT1H
Lifetime of ID token issued to client
additionalAudiencesForIdToken
Set<String>
Adds additional valid audiences for ID token. This feature does not involve any policy controls or features that may be added in the future to support issuing tokens to parties other than the OIDC client. It should be used with caution, and in most cases avoided.
alwaysIncludedAttributes
Set<String>
Specifies IdPAttributes to always include in ID token regardless of response_type
issueIdTokenViaRefreshToken 3.4
Boolean
true
Whether to issue id_token when refresh_token grant type is used.
limitInitialAccessTokenToSelf 4.2
Boolean
false
Whether the initial access token audience is solely to self (i.e. UserInfo). This flag is only respected when both openid scope and authorization code grant are involved.
Manipulation strategy for customising id_token contents. The BiFunction inputs are the ProfileRequestContext and the current contents of id_token as a Map<String,Object>.
If the result is non-null, the result (Map<String,Object) is used to replace the contents of the id_token. It is the deployer’s responsibility to ensure the results remain valid/appropriate.
The following properties can be used to globally adjust some of the settings above (some of them affect other profiles as well).
idp.oauth2.encryptionOptional
idp.oidc.idToken.defaultLifetime
idp.oidc.alwaysIncludedAttributes
idp.oidc.issueIdTokenViaRefreshToken 3.4
The final option relates to "claims splitting" and override the typical processing rules for when to insert claims into particular tokens. Typically most "data" is omitted from the front-channel ID token unless no authorization code is being issued, with the claims only accessed via the UserInfo endpoint. This setting forces claims into or out of the ID token.
Replay and Revocation
Authorization codes are bearer tokens and have to be limited to a single use as a security measure. Reuse is monitored by storing reference values in the existing IdP replay cache that handles related SAML and CAS needs. It should be noted that the criticality of this cache to CAS and OIDC are generally much higher than for SAML (unless SAML artifacts are used), and the limitations of an in-memory cache that is not clustered across servers much more severe.
Reuse of an authorization code invalidates all tokens derived from it by tracking revoked codes. This is handled by another (obviously server-side) cache, the revocation cache.
Two properties are provided in conf/oidc.properties to control aspects of this process:
idp.oidc.revocationCache.authorizeCode.lifetime
Lifetime of entries stored in the revocation cache (covering the entire token chain), defaults to 6 hours.
Since V3.4, if the relying party has the revocation profile enabled, the lifetime is taken from the revocationLifetime profile configuration value (see OPRevocation | ConfigurationPreview). By default, that value is taken from the idp.oidc.revocationCache.authorizeCode.lifetime property.
idp.oidc.revocationCache.StorageService
Bean ID of StorageService for revocation cache, requires server-side storage. Defaults to shibboleth.StorageService (in-memory).
Since V3.2, via support for revoking single tokens instead of the whole chain (see OPRevocation | ConfigurationPreview), an attempt to use a revoked refresh token causes the whole chain derived from the single revoked token to be revoked. The lifetime for this revocation record is then taken from OPRevocation | ConfigurationPreview.
Bi-function bean to enforce the given policy (second input) to the given object (first input). The result is a pair: the first item describing the object after enforcing policy and the second indicating whether the operation was successful.