Package org.forgerock.oauth2.core
Interface ScopeValidator
- All Superinterfaces:
org.forgerock.oauth2.core.plugins.AccessTokenEnricher,AccessTokenModifier,AuthorizeEndpointDataProvider,org.forgerock.oauth2.core.plugins.OAuth2Plugin,ScopeEvaluator,ScopeValidator,UserInfoClaimsPlugin
@SupportedAll
@Deprecated
public interface ScopeValidator
extends ScopeValidator, UserInfoClaimsPlugin, ScopeEvaluator, AuthorizeEndpointDataProvider, org.forgerock.oauth2.core.plugins.AccessTokenEnricher, AccessTokenModifier
Deprecated.
since 7.2.0
Provided as extension points to allow the OAuth2 provider to customise the requested scope of authorize,
access token and refresh token requests and to allow the OAuth2 provider to return additional data from these
endpoints as well.
- Since:
- 12.0.0
-
Method Summary
Modifier and TypeMethodDescriptionadditionalDataToReturnFromAuthorizeEndpoint(Map<String, Token> tokens, OAuth2Request request) Deprecated.since 7.2.0 UseAuthorizeEndpointDataProvider.provide(Map, OAuth2Request)instead.voidadditionalDataToReturnFromTokenEndpoint(AccessToken accessToken, OAuth2Request request) Deprecated.since 7.2.0 UseAccessTokenModifier.modifyAccessToken(AccessToken, OAuth2Request)instead.default voidenrich(AccessToken accessToken, OAuth2Request request) Deprecated.evaluateScope(AccessToken accessToken) Deprecated.since 7.2.0 UseScopeEvaluator.evaluateScope(AccessToken)instead.getUserInfo(org.forgerock.oauth2.core.ClientRegistration clientRegistration, AccessToken token, OAuth2Request request) Deprecated.since 7.2.0 UseUserInfoClaimsPlugin.getUserInfo(ClientRegistration, AccessToken, OAuth2Request)instead.default voidmodifyAccessToken(AccessToken accessToken, OAuth2Request request) Deprecated.since 7.2.0 UseAccessTokenModifier.modifyAccessToken(AccessToken, OAuth2Request)instead.provide(Map<String, Token> tokens, OAuth2Request request) Deprecated.Provided as an extension point to allow the OAuth2 provider to return additional data from an authorization request.validateAccessTokenScope(org.forgerock.oauth2.core.ClientRegistration clientRegistration, Set<String> scope, OAuth2Request request) Deprecated.since 7.2.0 Use#validateAccessTokenScope(ClientRegistration, Set, OAuth2Request)instead.validateAuthorizationScope(org.forgerock.oauth2.core.ClientRegistration clientRegistration, Set<String> scope, OAuth2Request request) Deprecated.since 7.2.0 Use#validateAuthorizationScope(ClientRegistration, Set, OAuth2Request)instead.validateBackChannelAuthorizationScope(org.forgerock.oauth2.core.ClientRegistration clientRegistration, Set<String> requestedScopes, OAuth2Request request) Deprecated.since 7.2.0 Use#validateBackChannelAuthorizationScope(ClientRegistration, Set, OAuth2Request)instead.validateRefreshTokenScope(org.forgerock.oauth2.core.ClientRegistration clientRegistration, Set<String> requestedScope, Set<String> tokenScope, OAuth2Request request) Deprecated.since 7.2.0 Use#validateRefreshTokenScope(ClientRegistration, Set, Set, OAuth2Request)instead.
-
Method Details
-
validateAuthorizationScope
@Deprecated Set<String> validateAuthorizationScope(org.forgerock.oauth2.core.ClientRegistration clientRegistration, Set<String> scope, OAuth2Request request) throws org.forgerock.oauth2.core.exceptions.InvalidScopeException, org.forgerock.oauth2.core.exceptions.ServerException Deprecated.since 7.2.0 Use#validateAuthorizationScope(ClientRegistration, Set, OAuth2Request)instead.Provided as an extension point to allow the OAuth2 provider to customise the scope requested when authorization is requested.- Specified by:
validateAuthorizationScopein interfaceScopeValidator- Parameters:
clientRegistration- The client registration.scope- The requested scope.request- The OAuth2 request.- Returns:
- The updated scope used in the remaining OAuth2 process.
- Throws:
org.forgerock.oauth2.core.exceptions.InvalidScopeException- If the requested scope is invalid, unknown, or malformed.org.forgerock.oauth2.core.exceptions.ServerException- If any internal server error occurs.
-
validateAccessTokenScope
@Deprecated Set<String> validateAccessTokenScope(org.forgerock.oauth2.core.ClientRegistration clientRegistration, Set<String> scope, OAuth2Request request) throws org.forgerock.oauth2.core.exceptions.InvalidScopeException, org.forgerock.oauth2.core.exceptions.ServerException Deprecated.since 7.2.0 Use#validateAccessTokenScope(ClientRegistration, Set, OAuth2Request)instead.Provided as an extension point to allow the OAuth2 provider to customise the scope requested when an access token is requested.- Specified by:
validateAccessTokenScopein interfaceScopeValidator- Parameters:
clientRegistration- The client registration.scope- The requested scope.request- The OAuth2 request.- Returns:
- The updated scope used in the remaining OAuth2 process.
- Throws:
org.forgerock.oauth2.core.exceptions.InvalidScopeException- If the requested scope is invalid, unknown, or malformed.org.forgerock.oauth2.core.exceptions.ServerException- If any internal server error occurs.
-
validateRefreshTokenScope
@Deprecated Set<String> validateRefreshTokenScope(org.forgerock.oauth2.core.ClientRegistration clientRegistration, Set<String> requestedScope, Set<String> tokenScope, OAuth2Request request) throws org.forgerock.oauth2.core.exceptions.ServerException, org.forgerock.oauth2.core.exceptions.InvalidScopeException Deprecated.since 7.2.0 Use#validateRefreshTokenScope(ClientRegistration, Set, Set, OAuth2Request)instead.Provided as an extension point to allow the OAuth2 provider to customise the scope requested when a refresh token is requested.- Specified by:
validateRefreshTokenScopein interfaceScopeValidator- Parameters:
clientRegistration- The client registration.requestedScope- The requested scope.tokenScope- The scope from the access token.request- The OAuth2 request.- Returns:
- The updated scope used in the remaining OAuth2 process.
- Throws:
org.forgerock.oauth2.core.exceptions.InvalidScopeException- If the requested scope is invalid, unknown, or malformed.org.forgerock.oauth2.core.exceptions.ServerException- If any internal server error occurs.
-
validateBackChannelAuthorizationScope
@Deprecated Set<String> validateBackChannelAuthorizationScope(org.forgerock.oauth2.core.ClientRegistration clientRegistration, Set<String> requestedScopes, OAuth2Request request) throws org.forgerock.oauth2.core.exceptions.InvalidScopeException, org.forgerock.oauth2.core.exceptions.ServerException Deprecated.since 7.2.0 Use#validateBackChannelAuthorizationScope(ClientRegistration, Set, OAuth2Request)instead.Provided as an extension point to allow the OAuth2 provider to customize the scope requested when performing a client initiated back channel authentication.- Specified by:
validateBackChannelAuthorizationScopein interfaceScopeValidator- Parameters:
clientRegistration- The client registration.requestedScopes- The requested scope.request- The OAuth2 request.- Returns:
- The updated scope used in the remaining OAuth2 process.
- Throws:
org.forgerock.oauth2.core.exceptions.InvalidScopeException- If the requested scope is invalid, unknown or malformed.org.forgerock.oauth2.core.exceptions.ServerException- If any internal server error occurs.
-
getUserInfo
@Deprecated UserInfoClaims getUserInfo(org.forgerock.oauth2.core.ClientRegistration clientRegistration, AccessToken token, OAuth2Request request) throws org.forgerock.oauth2.core.exceptions.UnauthorizedClientException, org.forgerock.oauth2.core.exceptions.NotFoundException, org.forgerock.oauth2.core.exceptions.ServerException, InvalidRequestException Deprecated.since 7.2.0 UseUserInfoClaimsPlugin.getUserInfo(ClientRegistration, AccessToken, OAuth2Request)instead.Gets the resource owners information based on an issued access token.- Specified by:
getUserInfoin interfaceUserInfoClaimsPlugin- Parameters:
clientRegistration- The client registration.token- The access token.request- The OAuth2 request.- Returns:
- A
Map<String, Object>of the resource owner's information. - Throws:
org.forgerock.oauth2.core.exceptions.UnauthorizedClientException- If the client's authorization fails.org.forgerock.oauth2.core.exceptions.NotFoundException- If the realm does not have an OAuth 2.0 provider service.org.forgerock.oauth2.core.exceptions.ServerException- If the client's authorization fails due to a server error.InvalidRequestException- If the client's authorization fails.
-
evaluateScope
Deprecated.since 7.2.0 UseScopeEvaluator.evaluateScope(AccessToken)instead.Gets the specified access token's information.- Specified by:
evaluateScopein interfaceScopeEvaluator- Parameters:
accessToken- The access token.- Returns:
- A
Map<String, Object>of the access token's information.
-
additionalDataToReturnFromAuthorizeEndpoint
@Deprecated Map<String,String> additionalDataToReturnFromAuthorizeEndpoint(Map<String, Token> tokens, OAuth2Request request) Deprecated.since 7.2.0 UseAuthorizeEndpointDataProvider.provide(Map, OAuth2Request)instead.Provided as an extension point to allow the OAuth2 provider to return additional data from an authorization request.- Parameters:
tokens- The tokens that will be returned from the authorization call.request- The OAuth2 request.- Returns:
- A
Map<String, String>of the additional data to return.
-
additionalDataToReturnFromTokenEndpoint
@Deprecated void additionalDataToReturnFromTokenEndpoint(AccessToken accessToken, OAuth2Request request) throws org.forgerock.oauth2.core.exceptions.ServerException, org.forgerock.oauth2.core.exceptions.InvalidClientException, org.forgerock.oauth2.core.exceptions.NotFoundException Deprecated.since 7.2.0 UseAccessTokenModifier.modifyAccessToken(AccessToken, OAuth2Request)instead. Functionality provided by Access Token Modification plugin supersedes the functionality this extension point was originally intended to provide.Provided as an extension point to allow the OAuth2 provider to return additional data from an access token request.
Any additional data to be returned should be added to the access token by invoking, AccessToken#addExtraData(String, String).- Parameters:
accessToken- The access token.request- The OAuth2 request.- Throws:
org.forgerock.oauth2.core.exceptions.ServerException- If any internal server error occurs.org.forgerock.oauth2.core.exceptions.InvalidClientException- If either the request does not contain the client's id or the client fails to be authenticated.org.forgerock.oauth2.core.exceptions.NotFoundException- If the realm does not have an OAuth 2.0 provider service.
-
modifyAccessToken
@Deprecated default void modifyAccessToken(AccessToken accessToken, OAuth2Request request) throws org.forgerock.oauth2.core.exceptions.NotFoundException, org.forgerock.oauth2.core.exceptions.ServerException, org.forgerock.oauth2.core.exceptions.UnauthorizedClientException Deprecated.since 7.2.0 UseAccessTokenModifier.modifyAccessToken(AccessToken, OAuth2Request)instead.Allows modification of the OAuth2 access token before the token is persisted/returned to the client.- Specified by:
modifyAccessTokenin interfaceAccessTokenModifier- Parameters:
accessToken- The access token.request- The OAuth2 request.- Throws:
org.forgerock.oauth2.core.exceptions.NotFoundException- If the realm does not have an OAuth 2.0 provider service.org.forgerock.oauth2.core.exceptions.ServerException- If any internal server error occurs.org.forgerock.oauth2.core.exceptions.UnauthorizedClientException- If the client identity cannot be obtained.
-
enrich
default void enrich(AccessToken accessToken, OAuth2Request request) throws org.forgerock.oauth2.core.exceptions.ServerException, org.forgerock.oauth2.core.exceptions.InvalidClientException, org.forgerock.oauth2.core.exceptions.NotFoundException Deprecated.- Throws:
org.forgerock.oauth2.core.exceptions.ServerExceptionorg.forgerock.oauth2.core.exceptions.InvalidClientExceptionorg.forgerock.oauth2.core.exceptions.NotFoundException
-
provide
Deprecated.Description copied from interface:AuthorizeEndpointDataProviderProvided as an extension point to allow the OAuth2 provider to return additional data from an authorization request.- Specified by:
providein interfaceAuthorizeEndpointDataProvider- Parameters:
tokens- The tokens that will be returned from the authorization call.request- The OAuth2 request.- Returns:
- A
Map<String, String>of the additional data to return.
-