Package com.authlete.jaxrs
Class BaseDeviceAuthorizationEndpoint
- java.lang.Object
-
- com.authlete.jaxrs.BaseEndpoint
-
- com.authlete.jaxrs.BaseDeviceAuthorizationEndpoint
-
public class BaseDeviceAuthorizationEndpoint extends BaseEndpoint
A base class for device authorization endpoints.- Since:
- 2.18
- Author:
- Hideki Ikeda
-
-
Constructor Summary
Constructors Constructor Description BaseDeviceAuthorizationEndpoint()
-
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, DeviceAuthorizationRequestHandler.Params params)
Handle a device authorization request.javax.ws.rs.core.Response
handle(com.authlete.common.api.AuthleteApi api, javax.ws.rs.core.MultivaluedMap<String,String> parameters, String authorization, String[] clientCertificatePath)
Handle a device authorization 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, javax.ws.rs.core.MultivaluedMap<String,String> parameters, String authorization, String[] clientCertificatePath)
Handle a device authorization request.This method internally creates a
DeviceAuthorizationRequestHandler
instance and calls itsDeviceAuthorizationRequestHandler.handle(Params)
method. Then, this method uses the value returned from thehandle()
method as a response from this method.When
DeviceAuthorizationRequestHandler.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 ofDeviceAuthorizationRequestHandlerSpi
.parameters
- Request parameters of the device authorization request.authorization
- The value ofAuthorization
header of the device authorization request.clientCertificatePath
- The certificate path used in mutual TLS authentication, 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.
-
handle
public javax.ws.rs.core.Response handle(com.authlete.common.api.AuthleteApi api, DeviceAuthorizationRequestHandler.Params params)
Handle a device authorization request.- Parameters:
api
- An implementation ofAuthleteApi
.params
- Parameters for Authlete's/device/authorization
API.- Returns:
- A response that should be returned to the client application.
- Since:
- 2.79
-
-