Package com.authlete.jaxrs
Class BaseTokenEndpoint
- java.lang.Object
-
- com.authlete.jaxrs.BaseEndpoint
-
- com.authlete.jaxrs.BaseTokenEndpoint
-
public class BaseTokenEndpoint extends BaseEndpoint
A base class for token endpoints.- Since:
- 1.2
- Author:
- Takahiko Kawasaki
- See Also:
- RFC 6749, 3.2. Token Endpoint, OpenID Connect Core 1.0, 3.3.3. Token Endpoint
-
-
Constructor Summary
Constructors Constructor Description BaseTokenEndpoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
handle(com.authlete.common.api.AuthleteApi api, TokenRequestHandlerSpi spi, TokenRequestHandler.Params params)
Handle a token request.javax.ws.rs.core.Response
handle(com.authlete.common.api.AuthleteApi api, TokenRequestHandlerSpi spi, javax.ws.rs.core.MultivaluedMap<String,String> parameters, String authorization)
Handle a token request.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.-
Methods inherited from class com.authlete.jaxrs.BaseEndpoint
extractClientCertificate, extractClientCertificateChain, extractHeadersAsPairs, onError, takeAttribute
-
-
-
-
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)
Handle a token request. This method is an alias of thehandle(AuthleteApi, TokenRequestHandlerSpi, TokenRequestHandler.Params)
method.- Parameters:
api
- An implementation ofAuthleteApi
.spi
- An implementation ofTokenRequestHandlerSpi
.parameters
- Request parameters of the token request.authorization
- The value ofAuthorization
header of the token request.- Returns:
- A response that should be returned to the client application.
-
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 thehandle(AuthleteApi, TokenRequestHandlerSpi, TokenRequestHandler.Params)
method.- Parameters:
api
- An implementation ofAuthleteApi
.spi
- An implementation ofTokenRequestHandlerSpi
.parameters
- Request parameters of the token request.authorization
- The value ofAuthorization
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 benull
.- 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 itshandle(Params)
method. Then, this method uses the value returned from thehandle()
method as a response from this method.When
TokenRequestHandler.handle()
method raises aWebApplicationException
, this method callsonError()
method with the exception. The default implementation ofonError()
does nothing. You can override the method as necessary. After callingonError()
method, this method callsgetResponse()
method of the exception and uses the returned value as a response from this method.- Parameters:
api
- An implementation ofAuthleteApi
.spi
- An implementation ofTokenRequestHandlerSpi
.params
- Parameters needed to handle the token request.- Returns:
- A response that should be returned to the client application.
- Since:
- 2.27
-
-