@Singleton public class OpenAMScopeValidator extends Object implements ScopeValidator
Constructor and Description |
---|
OpenAMScopeValidator(IdentityManager identityManager,
OpenIDTokenIssuer openIDTokenIssuer,
OAuth2ProviderSettingsFactory providerSettingsFactory,
OpenAMSettings openAMSettings,
ScriptEvaluator scriptEvaluator,
ScriptingServiceFactory scriptingServiceFactory,
TokenRestrictionResolver agentValidator,
SessionService sessionService)
Constructs a new OpenAMScopeValidator.
|
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.
|
Map<String,Object> |
evaluateScope(AccessToken accessToken)
Gets the specified access token's information.
|
UserInfoClaims |
getUserInfo(ClientRegistration clientRegistration,
AccessToken token,
OAuth2Request request)
Gets the resource owners information based on an issued access token.
|
Set<String> |
validateAccessTokenScope(ClientRegistration client,
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 client,
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.
|
@Inject public OpenAMScopeValidator(IdentityManager identityManager, OpenIDTokenIssuer openIDTokenIssuer, OAuth2ProviderSettingsFactory providerSettingsFactory, OpenAMSettings openAMSettings, @Named(value="OIDC_CLAIMS") ScriptEvaluator scriptEvaluator, ScriptingServiceFactory scriptingServiceFactory, TokenRestrictionResolver agentValidator, SessionService sessionService)
identityManager
- An instance of the IdentityManager.openIDTokenIssuer
- An instance of the OpenIDTokenIssuer.providerSettingsFactory
- An instance of the CTSPersistentStore.openAMSettings
- An instance of the OpenAMSettings.scriptEvaluator
- An instance of the OIDC Claims ScriptEvaluator.scriptingServiceFactory
- An instance of the ScriptingServiceFactory.agentValidator
- An instance of LDAPAgentValidator
used to retrieve the token restriction.sessionService
- An instance of SessionService
.public Set<String> validateAuthorizationScope(ClientRegistration client, Set<String> scope, OAuth2Request request) throws InvalidScopeException, ServerException
validateAuthorizationScope
in interface ScopeValidator
client
- The client registration.scope
- The requested scope.request
- The OAuth2 request.InvalidScopeException
- If the requested scope is invalid, unknown, or malformed.ServerException
- If any internal server error occurs.public Set<String> validateAccessTokenScope(ClientRegistration client, Set<String> scope, OAuth2Request request) throws InvalidScopeException, ServerException
validateAccessTokenScope
in interface ScopeValidator
client
- The client registration.scope
- The requested scope.request
- The OAuth2 request.InvalidScopeException
- If the requested scope is invalid, unknown, or malformed.ServerException
- If any internal server error occurs.public Set<String> validateRefreshTokenScope(ClientRegistration clientRegistration, Set<String> requestedScope, Set<String> tokenScope, OAuth2Request request) throws ServerException, InvalidScopeException
validateRefreshTokenScope
in interface ScopeValidator
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.public UserInfoClaims getUserInfo(ClientRegistration clientRegistration, AccessToken token, OAuth2Request request) throws UnauthorizedClientException, NotFoundException
getUserInfo
in interface ScopeValidator
clientRegistration
- The client registration.token
- The access token.request
- The OAuth2 request.Map<String, Object>
of the resource owner's information.UnauthorizedClientException
- If the client's authorization fails.NotFoundException
- If the realm does not have an OAuth 2.0 provider service.public Map<String,Object> evaluateScope(AccessToken accessToken)
evaluateScope
in interface ScopeValidator
accessToken
- The access token.Map<String, Object>
of the access token's information.public Map<String,String> additionalDataToReturnFromAuthorizeEndpoint(Map<String,Token> tokens, OAuth2Request request)
additionalDataToReturnFromAuthorizeEndpoint
in interface ScopeValidator
tokens
- The tokens that will be returned from the authorization call.request
- The OAuth2 request.Map<String, String>
of the additional data to return.public void additionalDataToReturnFromTokenEndpoint(AccessToken accessToken, OAuth2Request request) throws ServerException, InvalidClientException, NotFoundException
additionalDataToReturnFromTokenEndpoint
in interface ScopeValidator
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.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.