Class ConfigurationRequestHandler


  • public class ConfigurationRequestHandler
    extends Object
    Handler for requests to an OpenID Provider configuration endpoint.

    An OpenID Provider that supports OpenID Connect Discovery 1.0 must provide an endpoint that returns its configuration information in a JSON format. Details about the format are described in "3. OpenID Provider Metadata" in OpenID Connect Discovery 1.0.

    In an implementation of configuration endpoint, call handle() method and use the response as the response from the endpoint to the client application.

    Note that the URI of an OpenID Provider configuration endpoint is defined in "4.1. OpenID Provider Configuration Request" in OpenID Connect Discovery 1.0. In short, the URI must be:

    Issuer Identifier + /.well-known/openid-configuration

    Issuer Identifier is a URL to identify an OpenID Provider. For example, https://example.com. For details about Issuer Identifier, See issuer in "3. OpenID Provider Metadata" (OpenID Connect Discovery 1.0) and iss in "2. ID Token" (OpenID Connect Core 1.0).

    You can change the Issuer Identifier of your service using the management console (Service Owner Console). Note that the default value of Issuer Identifier is not appropriate for commercial use, so you should change it.

    Since:
    1.1
    Author:
    Takahiko Kawasaki
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigurationRequestHandler​(com.authlete.common.api.AuthleteApi api)
      Constructor with an implementation of AuthleteApi interface.
    • Constructor Detail

      • ConfigurationRequestHandler

        public ConfigurationRequestHandler​(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 an OpenID Provider configuration 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 an OpenID Provider configuration endpoint. This method internally calls Authlete's /api/service/configuration 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.
      • handle

        public javax.ws.rs.core.Response handle​(com.authlete.common.dto.ServiceConfigurationRequest request)
                                         throws javax.ws.rs.WebApplicationException
        Handle a request to an OpenID Provider configuration endpoint. This method internally calls Authlete's /api/service/configuration API.
        Parameters:
        request - Request parameters to the Authlete API.
        Returns:
        A response that should be returned from the discovery endpoint.
        Throws:
        javax.ws.rs.WebApplicationException - An error occurred.
        Since:
        2.50
      • getApiCaller

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

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