Package com.authlete.jaxrs
Class DeviceCompleteRequestHandler
- java.lang.Object
-
- com.authlete.jaxrs.DeviceCompleteRequestHandler
-
public class DeviceCompleteRequestHandler extends Object
Handler for processing the result of end-user authentication and authorization in OAuth 2.0 Device Authorization Grant (Device Flow).handle()
method should be called after the authorization server receives the result of end-user authentication and authorization, or even in the case where the server gave up getting the result for some reasons. Thehandle()
method calls Authlete's/api/device/complete
API, receives a response from the API, and dispatches processing according to theaction
parameter in the response.- Since:
- 2.18
- Author:
- Hideki Ikeda
-
-
Constructor Summary
Constructors Constructor Description DeviceCompleteRequestHandler(com.authlete.common.api.AuthleteApi api, DeviceCompleteRequestHandlerSpi spi)
Constructor with an implementation ofAuthleteApi
interface and an implementation ofDeviceCompleteRequestHandlerSpi
interface.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.authlete.jaxrs.AuthleteApiCaller
getApiCaller()
javax.ws.rs.core.Response
handle(String userCode, String[] claimNames)
Handle the result of end-user authentication and authorization in OAuth 2.0 Device Authorization Grant (Device Flow).protected javax.ws.rs.InternalServerErrorException
unexpected(String message, Throwable cause)
-
-
-
Constructor Detail
-
DeviceCompleteRequestHandler
public DeviceCompleteRequestHandler(com.authlete.common.api.AuthleteApi api, DeviceCompleteRequestHandlerSpi spi)
Constructor with an implementation ofAuthleteApi
interface and an implementation ofDeviceCompleteRequestHandlerSpi
interface.- Parameters:
api
- Implementation ofAuthleteApi
interface.spi
- Implementation ofDeviceCompleteRequestHandlerSpi
interface.
-
-
Method Detail
-
handle
public javax.ws.rs.core.Response handle(String userCode, String[] claimNames) throws javax.ws.rs.WebApplicationException
Handle the result of end-user authentication and authorization in OAuth 2.0 Device Authorization Grant (Device Flow).- Parameters:
userCode
- The user code that the end-user input.claimNames
- Names of requested claims. Use the value of theclaimNames
parameter in a response from Authlete's/api/device/verification
API.- Returns:
- A response that should be returned to the end-user.
- Throws:
javax.ws.rs.WebApplicationException
- An error occurred.
-
getApiCaller
protected com.authlete.jaxrs.AuthleteApiCaller getApiCaller()
-
-