Interface OAuthDataProvider

    • Method Detail

      • revokeToken

        void revokeToken​(Client client,
                         String tokenId,
                         String tokenTypeHint)
                  throws OAuthServiceException
        Revokes a refresh or access token
        Parameters:
        client - the client
        tokenId - token identifier
        tokenTypeHint - can be access_token or refresh_token or null
        Throws:
        OAuthServiceException
      • revokeToken

        default void revokeToken​(Client client,
                                 UserSubject callerSubject,
                                 String tokenId,
                                 String tokenTypeHint)
                          throws OAuthServiceException
        Revokes a refresh or access token, verifying that the authenticated resource owner's identity (callerSubject) matches the subject bound to the token. This prevents one user from revoking another user's token when multiple resource owners share the same OAuth2 client (IDOR guard).

        callerSubject may be null for machine-to-machine (client credentials) flows where no end-user principal is present; in that case only the client-level check is applied.

        Parameters:
        client - the authenticated client
        callerSubject - the authenticated resource owner, or null for M2M flows
        tokenId - token identifier
        tokenTypeHint - can be access_token or refresh_token or null
        Throws:
        OAuthServiceException
      • convertScopeToPermissions

        List<OAuthPermission> convertScopeToPermissions​(Client client,
                                                        List<String> requestedScopes)
        Converts the requested scopes to the list of permissions. The scopes are extracted from OAuth2 'scope' property which if set may contain one or more space separated scope values
        Parameters:
        requestedScopes - the scopes
        Returns:
        list of permissions