public interface OAuth2ProviderSettings
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
additionalDataToReturnFromAuthorizeEndpoint(Map<String,Token> tokens,
OAuth2Request request)
Provided as an extension point to allow the OAuth2 provider to return additional data from an authorization
request.
|
void |
additionalDataToReturnFromTokenEndpoint(AccessToken accessToken,
OAuth2Request request)
Provided as an extension point to allow the OAuth2 provider to return additional data from an access token
request.
|
boolean |
clientsCanSkipConsent()
Whether clients can opt to skip resource owner consent during authorization flows.
|
Map<String,Object> |
evaluateScope(AccessToken accessToken)
Gets the specified access token's information.
|
boolean |
exists()
Checks whether the config exists.
|
long |
getAccessTokenLifetime()
Gets the lifetime an access token will have before it expires.
|
Map<String,AuthenticationMethod> |
getAcrMapping()
Returns a mapping from Authentication Context Class Reference (ACR) values (typically a Level of Assurance
value) to concrete authentication methods.
|
Map<String,ResponseTypeHandler> |
getAllowedResponseTypes()
Gets the response types allowed by the OAuth2 provider.
|
Map<String,String> |
getAMRAuthModuleMappings()
The mappings between amr values and auth module names.
|
long |
getAuthorizationCodeLifetime()
Gets the lifetime an authorization code will have before it expires.
|
boolean |
getClaimsParameterSupported()
Returns whether this provider supports claims requested via 'claims' parameter.
|
String |
getCompletionUrl()
The URL that the user will be sent to on completion of their OAuth 2 login
and consent when using the device code flow.
|
String |
getCreatedTimestampAttributeName()
Gets the created timestamp attribute name.
|
freemarker.template.Template |
getCustomLoginUrlTemplate()
Gets the custom login url template which will create the url to redirect resource owners to for authentication.
|
String |
getDefaultAcrValues()
The default Authentication Context Class Reference (ACR) values to use for authentication if none is specified
in the request.
|
Set<String> |
getDefaultScopes()
Gets the default set of scopes to give a client registering with this provider.
|
int |
getDeviceCodeLifetime()
The lifetime of the device code.
|
int |
getDeviceCodePollInterval()
The polling interval for devices waiting for tokens when using the device code flow.
|
Set<String> |
getEndpointAuthMethodsSupported()
Returns the token_endpoint_auth_methods available for clients to register (and subsequently auth) using.
|
String |
getHashSalt()
Returns the salt to use for hashing sub values upon pairwise requests.
|
org.forgerock.json.JsonValue |
getJWKSet()
Gets the JWK Set for this OAuth2 Authorization /OpenID Provider.
|
String |
getJWKSUri()
Gets the JSON Web Key Set URI.
|
String |
getModifiedTimestampAttributeName()
Gets the modified timestamp attribute name.
|
String |
getOpenIDConnectVersion()
Gets the supported version of the OpenID Connect specification.
|
long |
getOpenIdTokenLifetime()
Gets the lifetime an OpenID token will have before it expires.
|
long |
getRefreshTokenLifetime()
Gets the lifetime an refresh token will have before it expires.
|
Set<String> |
getResourceOwnerAuthenticatedAttributes()
Gets the attributes of the resource owner that are used for authenticating resource owners.
|
ResourceSetStore |
getResourceSetStore()
Returns the ResourceSetStore instance for the realm.
|
KeyPair |
getSigningKeyPair(org.forgerock.json.jose.jws.JwsAlgorithm algorithm)
Gets the signing key pair of the OAuth2 provider.
|
Set<String> |
getSupportedClaims()
Gets the supported claims for this provider.
|
Set<String> |
getSupportedClaimsWithTranslations()
Gets the supported claims for this provider as strings with pipe-separated translations.
|
Set<String> |
getSupportedIDTokenEncryptionAlgorithms()
Gets the algorithms that the OAuth2 provider supports for encryptin OpenID tokens.
|
Set<String> |
getSupportedIDTokenEncryptionMethods()
Gets the encryption methods that the OAuth2 provider supports for encryptin OpenID tokens.
|
Set<String> |
getSupportedIDTokenSigningAlgorithms()
Gets the algorithms that the OAuth2 provider supports for signing OpenID tokens.
|
Set<String> |
getSupportedScopes()
Gets the supported scopes for this provider without translations.
|
Set<String> |
getSupportedScopesWithTranslations()
Gets the supported scopes for this provider.
|
Set<String> |
getSupportedSubjectTypes()
Gets the subject types supported by the OAuth2 provider.
|
String |
getTokenHmacSharedSecret()
Gets the Base64 encoded shared secret used to sign stateless access and refresh tokens.
|
String |
getTokenSigningAlgorithm()
Gets the signing algorithm used when issuing stateless access and refresh tokens.
|
String |
getUserDisplayNameAttribute()
The attribute that can be used to obtain a UI-displayable name for a user's AMIdentity.
|
UserInfoClaims |
getUserInfo(ClientRegistration clientRegistration,
AccessToken token,
OAuth2Request request)
Gets the resource owners information based on an issued access token or request.
|
String |
getVerificationUrl()
The URL that the user will be instructed to visit to complete their OAuth 2 login and consent when using the
device code flow.
|
boolean |
isAlwaysAddClaimsToToken()
Whether to always add claims to id_tokens - non-spec compliant.
|
boolean |
isCodeVerifierRequired()
Whether or not to enforce the Code Verifier Parameter.
|
boolean |
isConsentSaved(ResourceOwner resourceOwner,
String clientId,
Set<String> scope)
Determines whether a resource owner's consent has been saved from a previous authorize request.
|
boolean |
isIdTokenInfoClientAuthenticationEnabled()
Determines whether idtokeninfo endpoint should require client authentication.
|
boolean |
isOpenDynamicClientRegistrationAllowed()
Indicates whether clients may register without providing an access token.
|
boolean |
isOpenIDConnectSSOProviderEnabled()
Whether OpenID Connect ID Tokens are accepted as SSOTokens in this realm or not.
|
boolean |
isRegistrationAccessTokenGenerationEnabled()
Whether to generate access tokens for clients that register without one.
|
boolean |
isSaveConsentEnabled()
Determines if the consent can be saved or not, due to a lack of configuration.
|
boolean |
isStatelessTokensEnabled()
Determines whether access and refresh tokens should be stateless.
|
boolean |
issueRefreshTokens()
Whether the OAuth2 provider should issue refresh tokens when issuing access tokens.
|
boolean |
issueRefreshTokensOnRefreshingToken()
Whether the OAuth2 provider should issue refresh tokens when refreshing access tokens.
|
boolean |
isTokenCompressionEnabled()
Determines whether token compression is enabled for stateless access and refresh tokens.
|
void |
revokeConsent(String userId,
String clientId)
Revokes the resource owner's consent for the granting authorization for the specified client.
|
void |
saveConsent(ResourceOwner resourceOwner,
String clientId,
Set<String> scope)
Saves the resource owner's consent for the granting authorization for the specified client with the specified
scope.
|
boolean |
shouldStoreOpsTokens()
Whether to generate and store an ops token in CTS for this OIDC provider.
|
Set<String> |
validateAccessTokenScope(ClientRegistration clientRegistration,
Set<String> scope,
OAuth2Request request)
Provided as an extension point to allow the OAuth2 provider to customise the scope requested when an access token
is requested.
|
Set<String> |
validateAuthorizationScope(ClientRegistration clientRegistration,
Set<String> scope,
OAuth2Request request)
Provided as an extension point to allow the OAuth2 provider to customise the scope requested when authorization
is requested.
|
Set<String> |
validateRefreshTokenScope(ClientRegistration clientRegistration,
Set<String> requestedScope,
Set<String> tokenScope,
OAuth2Request request)
Provided as an extension point to allow the OAuth2 provider to customise the scope requested when a refresh token
is requested.
|
String |
validateRequestedClaims(String requestedClaims)
Validates that the requested claims are appropriate to be requested by the given client.
|
boolean isStatelessTokensEnabled() throws ServerException
true
if access and refresh tokens are stateless.ServerException
- If any internal server error occurs.boolean isIdTokenInfoClientAuthenticationEnabled() throws ServerException
true
if idtokeninfo endpoint requires client authentication.ServerException
- If any internal server error occurs.String getTokenSigningAlgorithm() throws ServerException
ServerException
- If any internal server error occurs.boolean isTokenCompressionEnabled() throws ServerException
ServerException
- if an error occurs reading the settings.String getTokenHmacSharedSecret() throws ServerException
ServerException
- If any internal server error occurs.Map<String,ResponseTypeHandler> getAllowedResponseTypes() throws UnsupportedResponseTypeException, ServerException
UnsupportedResponseTypeException
- If the requested response type is not supported by either the client
or the OAuth2 provider.ServerException
- If any internal server error occurs.boolean isSaveConsentEnabled()
true
if the consent can be saved, false if it is not configured properly.boolean isConsentSaved(ResourceOwner resourceOwner, String clientId, Set<String> scope)
resourceOwner
- The resource owner.clientId
- The if of the client making the request.scope
- The requested scope.true
if the resource owner has previously requested that consent should be saved from the
specified client and the exact scope.Set<String> validateAuthorizationScope(ClientRegistration clientRegistration, Set<String> scope, OAuth2Request request) throws ServerException, InvalidScopeException
clientRegistration
- The client registration.scope
- The requested scope.ServerException
- If any internal server error occurs.InvalidScopeException
- If the requested scope is invalid, unknown, or malformed.Set<String> validateAccessTokenScope(ClientRegistration clientRegistration, Set<String> scope, OAuth2Request request) throws ServerException, InvalidScopeException
clientRegistration
- The client registration.scope
- The requested scope.request
- The OAuth2 request.ServerException
- If any internal server error occurs.InvalidScopeException
- If the requested scope is invalid, unknown, or malformed.Set<String> validateRefreshTokenScope(ClientRegistration clientRegistration, Set<String> requestedScope, Set<String> tokenScope, OAuth2Request request) throws ServerException, InvalidScopeException
clientRegistration
- The client registration.requestedScope
- The requested scope.tokenScope
- The scope from the access token.request
- The OAuth2 request.ServerException
- If any internal server error occurs.InvalidScopeException
- If the requested scope is invalid, unknown, or malformed.UserInfoClaims getUserInfo(ClientRegistration clientRegistration, AccessToken token, OAuth2Request request) throws ServerException, UnauthorizedClientException, NotFoundException
clientRegistration
- The client registration.token
- The access token.request
- The OAuth2 request.ServerException
- If any internal server error occurs.UnauthorizedClientException
- If the client's authorization fails.NotFoundException
- If the realm does not have an OAuth 2.0 provider service.Map<String,Object> evaluateScope(AccessToken accessToken) throws ServerException
accessToken
- The access token.Map<String, Object>
of the access token's information.ServerException
- If any internal server error occurs.Map<String,String> additionalDataToReturnFromAuthorizeEndpoint(Map<String,Token> tokens, OAuth2Request request) throws ServerException
tokens
- The tokens that will be returned from the authorization call.request
- The OAuth2 request.Map<String, String>
of the additional data to return.ServerException
- If any internal server error occurs.void additionalDataToReturnFromTokenEndpoint(AccessToken accessToken, OAuth2Request request) throws ServerException, InvalidClientException, NotFoundException
accessToken
- The access token.request
- The OAuth2 request.ServerException
- If any internal server error occurs.InvalidClientException
- If either the request does not contain the client's id or the client fails to be
authenticated.NotFoundException
- If the realm does not have an OAuth 2.0 provider service.void saveConsent(ResourceOwner resourceOwner, String clientId, Set<String> scope)
resourceOwner
- The resource owner.clientId
- The client id.scope
- The requested scope.void revokeConsent(String userId, String clientId)
userId
- The user id.clientId
- The client id.boolean issueRefreshTokens() throws ServerException
true
if refresh tokens should be issued.ServerException
- If any internal server error occurs.boolean issueRefreshTokensOnRefreshingToken() throws ServerException
true
if refresh tokens should be issued when access tokens are refreshed.ServerException
- If any internal server error occurs.long getAuthorizationCodeLifetime() throws ServerException
ServerException
- If any internal server error occurs.long getAccessTokenLifetime() throws ServerException
ServerException
- If any internal server error occurs.long getOpenIdTokenLifetime() throws ServerException
ServerException
- If any internal server error occurs.long getRefreshTokenLifetime() throws ServerException
ServerException
- If any internal server error occurs.KeyPair getSigningKeyPair(org.forgerock.json.jose.jws.JwsAlgorithm algorithm) throws ServerException
algorithm
- The signing algorithm.ServerException
- If any internal server error occurs.Set<String> getResourceOwnerAuthenticatedAttributes() throws ServerException
Set
of resource owner attributes.ServerException
- If any internal server error occurs.Set<String> getSupportedClaims() throws ServerException
Set
of the supported claims.ServerException
- If any internal server error occurs.Set<String> getSupportedClaimsWithTranslations() throws ServerException
Set
of the supported claims.ServerException
- If any internal server error occurs.Set<String> getSupportedScopes() throws ServerException
Set
of the supported scopes.ServerException
- If any internal server error occurs.Set<String> getSupportedScopesWithTranslations() throws ServerException
Set
of the supported scopes.ServerException
- If any internal server error occurs.Set<String> getDefaultScopes() throws ServerException
Set
of the default scopes.ServerException
- If any internal server error occurs.Set<String> getSupportedIDTokenSigningAlgorithms() throws ServerException
Set
of the supported algorithms.ServerException
- If any internal server error occurs.Set<String> getSupportedIDTokenEncryptionAlgorithms() throws ServerException
Set
of the supported algorithms.ServerException
- If any internal server error occurs.Set<String> getSupportedIDTokenEncryptionMethods() throws ServerException
Set
of the supported algorithms.ServerException
- If any internal server error occurs.String getOpenIDConnectVersion()
org.forgerock.json.JsonValue getJWKSet() throws ServerException
ServerException
String getCreatedTimestampAttributeName() throws ServerException
ServerException
String getModifiedTimestampAttributeName() throws ServerException
ServerException
Set<String> getSupportedSubjectTypes() throws ServerException
Set
of supported subject types.ServerException
- If any internal server error occurs.boolean isOpenDynamicClientRegistrationAllowed() throws ServerException
ServerException
- If any internal server error occurs.boolean isRegistrationAccessTokenGenerationEnabled() throws ServerException
isOpenDynamicClientRegistrationAllowed()
is true.ServerException
- If any internal server error occurs.Map<String,AuthenticationMethod> getAcrMapping() throws ServerException
ServerException
String getDefaultAcrValues() throws ServerException
ServerException
Map<String,String> getAMRAuthModuleMappings() throws ServerException
ServerException
boolean exists()
ResourceSetStore getResourceSetStore()
boolean getClaimsParameterSupported() throws ServerException
ServerException
String validateRequestedClaims(String requestedClaims) throws InvalidRequestException, ServerException
Set<String> getEndpointAuthMethodsSupported()
boolean isCodeVerifierRequired() throws ServerException
ServerException
String getHashSalt() throws ServerException
ServerException
boolean isAlwaysAddClaimsToToken() throws ServerException
ServerException
String getUserDisplayNameAttribute() throws ServerException
ServerException
String getJWKSUri() throws ServerException
ServerException
- If any internal server error occurs.freemarker.template.Template getCustomLoginUrlTemplate() throws ServerException
ServerException
- If the custom login url template setting could not be retrieved.String getVerificationUrl() throws ServerException
ServerException
- If the setting could not be retrieved.String getCompletionUrl() throws ServerException
ServerException
- If the setting could not be retrieved.int getDeviceCodeLifetime() throws ServerException
ServerException
- If the setting could not be retrieved.int getDeviceCodePollInterval() throws ServerException
ServerException
- If the setting could not be retrieved.boolean shouldStoreOpsTokens() throws ServerException
true
if ops tokens should be generated/stored in CTS.ServerException
- If the setting could not be retrieved.boolean clientsCanSkipConsent() throws ServerException
true
if clients are allowed to opt to skip resource owner consent.ServerException
- If the setting could not be retrieved.boolean isOpenIDConnectSSOProviderEnabled() throws ServerException
true
if ID Tokens are accepted as SSOTokens in this realm.ServerException
- If the setting could not be retrieved.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.