Class BaseDeviceCompleteEndpoint


  • public class BaseDeviceCompleteEndpoint
    extends BaseEndpoint
    A base class for device complete endpoints of OAuth 2.0 Device Authorization Grant (Device Flow).
    Since:
    2.18
    Author:
    Hideki Ikeda
    • Constructor Detail

      • BaseDeviceCompleteEndpoint

        public BaseDeviceCompleteEndpoint()
    • Method Detail

      • handle

        public javax.ws.rs.core.Response handle​(com.authlete.common.api.AuthleteApi api,
                                                DeviceCompleteRequestHandlerSpi spi,
                                                String userCode,
                                                String[] claimNames)
        Handle a device complete request.

        This method internally creates a DeviceCompleteRequestHandler instance and calls its DeviceCompleteRequestHandler.handle(String, String[]) method. Then, this method uses the value returned from the handle() method as a response from this method.

        When DeviceCompleteRequestHandler.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 DeviceCompleteRequestHandlerSpi.
        userCode - The user code that the end-user input.
        claimNames - Names of requested claims. Use the value of the claimNames parameter in a response from Authlete's /api/device/verification API.
        Returns:
        A response that should be returned to the end-user.