Class JwksRequestHandler


  • public class JwksRequestHandler
    extends Object
    Handler for requests to an endpoint that exposes JSON Web Key Set (RFC 7517) document.

    An OpenID Provider (OP) is required to expose its JSON Web Key Set document (JWK Set) so that client applications can (1) verify signatures by the OP and (2) encrypt their requests to the OP. The URI of a JWK Set endpoint can be found as the value of jwks_uri in OpenID Provider Metadata, if the OP supports OpenID Connect Discovery 1.0.

    Since:
    1.1
    Author:
    Takahiko Kawasaki
    • Constructor Detail

      • JwksRequestHandler

        public JwksRequestHandler​(com.authlete.common.api.AuthleteApi api)
        Constructor with an implementation of AuthleteApi interface.
        Parameters:
        api - Implementation of AuthleteApi interface.
    • Method Detail

      • handle

        public javax.ws.rs.core.Response handle()
                                         throws javax.ws.rs.WebApplicationException
        Handle a request to a JWK Set endpoint. This method is an alias of handle(true).
        Returns:
        A response that should be returned from the endpoint to the client application.
        Throws:
        javax.ws.rs.WebApplicationException - An error occurred.
      • handle

        public javax.ws.rs.core.Response handle​(boolean pretty)
                                         throws javax.ws.rs.WebApplicationException
        Handle a request to a JWK Set endpoint. This method internally calls Authlete's /api/service/jwks/get API.
        Parameters:
        pretty - true to return the output JSON in pretty format.
        Returns:
        A response that should be returned from the endpoint to the client application.
        Throws:
        javax.ws.rs.WebApplicationException - An error occurred.
      • getApiCaller

        protected com.authlete.jaxrs.AuthleteApiCaller getApiCaller()
      • unexpected

        protected javax.ws.rs.InternalServerErrorException unexpected​(String message,
                                                                      Throwable cause)