Class TokenInvalidator


  • public class TokenInvalidator
    extends Object
    Invalidates tokens and all their associated tokens. i.e. an Access Token and the Refresh Tokens and Authorization code used to issue or refresh it.
    Since:
    12.0.0
    • Constructor Detail

      • TokenInvalidator

        @Inject
        public TokenInvalidator​(TokenStore tokenStore,
                                OAuth2RealmResolver realmResolver)
        Constructs a new TokenInvalidator.
        Parameters:
        tokenStore - An instance of the TokenStore.
        realmResolver - An instance of the OAuth2RealmResolver
    • Method Detail

      • invalidateTokens

        public void invalidateTokens​(OAuth2Request request,
                                     String clientId,
                                     String userName,
                                     String authGrantId)
                              throws ServerException,
                                     NotFoundException
        Invalidates all tokens associated with same auth grant, client and resource owner.
        Parameters:
        request - The request.
        clientId - The client id.
        userName - The username denoting the resource owner id
        authGrantId - The auth grant id.
        Throws:
        ServerException - if an internal server error occurs while invalidating the tokens.
        NotFoundException - if the realm does not have an OAuth 2.0 provider service.