public class AccessTokenService extends Object
Constructor and Description |
---|
AccessTokenService(Map<String,GrantTypeHandler> grantTypeHandlers,
ClientAuthenticator clientAuthenticator,
TokenStore tokenStore,
OAuth2ProviderSettingsFactory providerSettingsFactory,
OAuth2UrisFactory urisFactory,
ConfirmationKeyValidator confirmationKeyValidator)
Constructs a new AccessTokenServiceImpl.
|
Modifier and Type | Method and Description |
---|---|
AccessToken |
refreshToken(OAuth2Request request)
Handles a request to refresh an already issued access token for a OAuth2 client, validates that the request is
valid and contains the required parameters, checks that the refresh token on the request is valid and has not
expired, or been previously used to refresh an access token.
|
AccessToken |
requestAccessToken(OAuth2Request request)
Handles a request for access token(s) by a OAuth2 client, validates that the request is valid and contains the
required parameters, checks that the authorization code on the request is valid and has not expired, or been
previously used.
|
@Inject public AccessTokenService(Map<String,GrantTypeHandler> grantTypeHandlers, ClientAuthenticator clientAuthenticator, TokenStore tokenStore, OAuth2ProviderSettingsFactory providerSettingsFactory, OAuth2UrisFactory urisFactory, ConfirmationKeyValidator confirmationKeyValidator)
grantTypeHandlers
- A Map
of the grant type handlers.clientAuthenticator
- An instance of the ClientAuthenticator.tokenStore
- An instance of the TokenStore.providerSettingsFactory
- An instance of the OAuth2ProviderSettingsFactory.urisFactory
- An instance of the OAuth2UrisFactory.public AccessToken requestAccessToken(OAuth2Request request) throws RedirectUriMismatchException, InvalidClientException, InvalidRequestException, InvalidCodeException, InvalidGrantException, ServerException, UnauthorizedClientException, InvalidScopeException, NotFoundException, AuthorizationPendingException, ExpiredTokenException, AuthorizationDeclinedException, BadRequestException
request
- The OAuth2Request for the client requesting an access token. Must not be null
.InvalidGrantException
- If the requested grant on the request is not supported.RedirectUriMismatchException
- If the redirect uri on the request does not match the redirect uri
registered for the client.InvalidClientException
- If either the request does not contain the client's id or the client fails to be
authenticated.InvalidRequestException
- If the request is missing any required parameters or is otherwise malformed.InvalidCodeException
- If the authorization code on the request has expired.ServerException
- If any internal server error occurs.UnauthorizedClientException
- If the client's authorization fails.IllegalArgumentException
- If the request is missing any required parameters.NotFoundException
- If the realm does not have an OAuth 2.0 provider service.InvalidScopeException
AuthorizationPendingException
ExpiredTokenException
AuthorizationDeclinedException
BadRequestException
public AccessToken refreshToken(OAuth2Request request) throws InvalidClientException, InvalidRequestException, BadRequestException, ServerException, ExpiredTokenException, InvalidGrantException, InvalidScopeException, NotFoundException
request
- The OAuth2Request for the client requesting an refresh token. Must not be null
.InvalidClientException
- If either the request does not contain the client's id or the client fails to be
authenticated.InvalidRequestException
- If the request is missing any required parameters or is otherwise malformed.BadRequestException
- If the request is malformed.ServerException
- If any internal server error occurs.ExpiredTokenException
- If the access token or refresh token has expired.IllegalArgumentException
- If the request is missing any required parameters.InvalidGrantException
- If the given token is not a refresh token.NotFoundException
- If the realm does not have an OAuth 2.0 provider service.InvalidScopeException
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.