UserInfoRequestHandler
extends BaseRequestHandler
in package
Handler for requests to a userinfo endpoint.
Table of Contents
Methods
- __construct() : mixed
- Constructor.
- getApi() : AuthleteApi
- Get the implementation of the AuthleteApi interface.
- handle() : Response
- Handle a userinfo request.
- unknownAction() : Response
- A utility method to generate a Response instance with "500 Internal Server Error" and an error message in JSON.
Methods
__construct()
Constructor.
public
__construct(AuthleteApi $api, UserInfoRequestHandlerSpi $spi) : mixed
Parameters
- $api : AuthleteApi
-
An implementation of the
AuthleteApi
interface. - $spi : UserInfoRequestHandlerSpi
-
An implementation of the
UserInfoRequestHandlerSpi
interface.
getApi()
Get the implementation of the AuthleteApi interface.
public
getApi() : AuthleteApi
The value returned from this method is the instance that was given to the constructor.
Return values
AuthleteApi —An implementation of the AuthleteApi
interface.
handle()
Handle a userinfo request.
public
handle(Request $request) : Response
This method calls Authlete's /api/auth/userinfo
API and conditionally
/api/auth/userinfo/issue
API.
Parameters
- $request : Request
Tags
Return values
Response —An HTTP response that should be returned from the userinfo endpoint implementation to the client application.
unknownAction()
A utility method to generate a Response instance with "500 Internal Server Error" and an error message in JSON.
protected
unknownAction(string $apiPath) : Response
This method is expected to be used when the value of the action
parameter in a response from an Authlete API holds an unexpected
value.
Parameters
- $apiPath : string
-
The path of an Authlete API.
Return values
Response —A Response instahce which represents a server error.