Interface OAuth2TokenKeyService

All Known Implementing Classes:
DefaultOAuth2TokenKeyService, SpringOAuth2TokenKeyService

public interface OAuth2TokenKeyService
Service that targets Identity service (xsuaa and identity) to request Json Web Keys.
  • Method Details

    • retrieveTokenKeys

      default String retrieveTokenKeys(@Nonnull URI tokenKeysEndpointUri, @Nullable String tenantId) throws OAuth2ServiceException
      Requests token web key set from Xsuaa OAuth Server.
      Parameters:
      tokenKeysEndpointUri - the token endpoint URI (jku).
      tenantId - the unique identifier of the tenant. Obligatory parameter in context of multi-tenant IAS applications to make sure that the tenant id belongs to the IAS tenant.
      Returns:
      list of JSON Web Token (JWT) keys as JSON string.
      Throws:
      OAuth2ServiceException - in case of an error during the http request.
    • retrieveTokenKeys

      @Deprecated default String retrieveTokenKeys(@Nonnull URI tokenKeysEndpointUri, @Nullable String tenantId, @Nullable String clientId) throws OAuth2ServiceException
      Deprecated.
      Use retrieveTokenKeys(URI, Map) instead Requests token web key set from IAS OAuth Server.
      Parameters:
      tokenKeysEndpointUri - the token endpoint URI (jku).
      tenantId - the unique identifier of the tenant. Obligatory parameter in context of multi-tenant IAS applications to make sure that the tenant id belongs to the IAS tenant.
      clientId - clientId from the service binding
      Returns:
      list of JSON Web Token (JWT) keys as JSON string.
      Throws:
      OAuth2ServiceException - in case of an error during the http request.
    • retrieveTokenKeys

      String retrieveTokenKeys(@Nonnull URI tokenKeysEndpointUri, Map<String,String> params) throws OAuth2ServiceException
      Retrieves the JWKS (JSON Web Key Set) from the OAuth2 Server.
      Parameters:
      tokenKeysEndpointUri - the JWKS endpoint URI.
      params - additional header parameters that are sent along with the request. Use constants from HttpHeaders for the header keys.
      Returns:
      a JWKS in JSON format.
      Throws:
      OAuth2ServiceException - in case of an error during the http request.