Class BaseTokenEndpoint

    • Constructor Detail

      • BaseTokenEndpoint

        public BaseTokenEndpoint()
    • Method Detail

      • handle

        public javax.ws.rs.core.Response handle​(com.authlete.common.api.AuthleteApi api,
                                                TokenRequestHandlerSpi spi,
                                                javax.ws.rs.core.MultivaluedMap<String,​String> parameters,
                                                String authorization,
                                                String[] clientCertificatePath)
        Handle a token request. This method is an alias of the handle(AuthleteApi, TokenRequestHandlerSpi, TokenRequestHandler.Params) method.
        Parameters:
        api - An implementation of AuthleteApi.
        spi - An implementation of TokenRequestHandlerSpi.
        parameters - Request parameters of the token request.
        authorization - The value of Authorization header of the token request.
        clientCertificatePath - The certificate path used in mutual TLS authentication, each in PEM format. The client's own certificate is the first in this array. Can be null.
        Returns:
        A response that should be returned to the client application.
        Since:
        2.8
      • handle

        public javax.ws.rs.core.Response handle​(com.authlete.common.api.AuthleteApi api,
                                                TokenRequestHandlerSpi spi,
                                                TokenRequestHandler.Params params)
        Handle a token request.

        This method internally creates a TokenRequestHandler instance and calls its handle(Params) method. Then, this method uses the value returned from the handle() method as a response from this method.

        When TokenRequestHandler.handle() method raises a WebApplicationException, this method calls onError() method with the exception. The default implementation of onError() does nothing. You can override the method as necessary. After calling onError() method, this method calls getResponse() method of the exception and uses the returned value as a response from this method.

        Parameters:
        api - An implementation of AuthleteApi.
        spi - An implementation of TokenRequestHandlerSpi.
        params - Parameters needed to handle the token request.
        Returns:
        A response that should be returned to the client application.
        Since:
        2.27