Authlete
TokenRequestHandler Class Reference

Handler for token requests to a token endpoint of OAuth 2.0 (RFC 6749). More...

Inheritance diagram for TokenRequestHandler:
BaseRequestHandler

Public Member Functions

 TokenRequestHandler (IAuthleteApi api, ITokenRequestHandlerSpi spi)
 Constructor. More...
 
async Task< HttpResponseMessage > Handle (string parameters, AuthenticationHeaderValue authorization)
 Handle a token request to a token endpoint. This method calls Authlete's /api/auth/token API and conditionally /api/auth/token/issue API or /api/token/issue/fail API. More...
 
async Task< HttpResponseMessage > Handle (string parameters, string authorizationHeaderValue)
 Handle a token request to a token endpoint. This method calls Authlete's /api/auth/token API and conditionally /api/auth/token/issue API or /api/token/issue/fail API. More...
 
async Task< HttpResponseMessage > Handle (string parameters, BasicCredentials credentials)
 Handle a token request to a token endpoint. This method calls Authlete's /api/auth/token API and conditionally /api/auth/token/issue API or /api/token/issue/fail API. More...
 
- Public Member Functions inherited from BaseRequestHandler
 BaseRequestHandler (IAuthleteApi api)
 Constructor with an implementation of the IAuthleteApi interface. The given value can be referred to as the value of the Api property later. More...
 

Additional Inherited Members

- Protected Member Functions inherited from BaseRequestHandler
HttpResponseMessage UnknownAction (string apiPath)
 A utility method to generate an HttpResponseMessage instance with "500 Internal Server Error" and an error message in JSON. 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. More...
 
- Properties inherited from BaseRequestHandler
IAuthleteApi Api [get]
 The implementation of the IAuthleteApi interface. It is the value given to the constructor. More...
 

Detailed Description

Handler for token requests to a token endpoint of OAuth 2.0 (RFC 6749).

Constructor & Destructor Documentation

◆ TokenRequestHandler()

Constructor.

Parameters
apiAn implementation of the IAuthleteApi interface.
Parameters
spiAn implementation of the Service Provider Interface. It is the customization point.

Member Function Documentation

◆ Handle() [1/3]

async Task<HttpResponseMessage> Handle ( string  parameters,
AuthenticationHeaderValue  authorization 
)
inline

Handle a token request to a token endpoint. This method calls Authlete's /api/auth/token API and conditionally /api/auth/token/issue API or /api/token/issue/fail API.

Returns
An HTTP response that should be returned from the token endpoint implementation to the client application.
Parameters
parametersForm parameters of the token request in application/x-www-form-urlencoded format. The value can be obtained by calling HttpRequestMessage.Content.ReadAsStringAsync.
Parameters
authorizationThe value of the Authorization header of the token request. The value can be obtained by calling HttpRequestMessage.Headers.Authorization. Note that token requests don't always have an Authorization header.
Exceptions
AuthleteApiException

◆ Handle() [2/3]

async Task<HttpResponseMessage> Handle ( string  parameters,
BasicCredentials  credentials 
)
inline

Handle a token request to a token endpoint. This method calls Authlete's /api/auth/token API and conditionally /api/auth/token/issue API or /api/token/issue/fail API.

Since version 1.0.3

Returns
An HTTP response that should be returned from the token endpoint implementation to the client application.
Parameters
parametersForm parameters of the token request in application/x-www-form-urlencoded format. The value can be obtained by calling HttpRequestMessage.Content.ReadAsStringAsync.
Parameters
credentialsThe pair of client ID and client secret that might be embedded in the Authorization header of the token request.
Exceptions
AuthleteApiException

◆ Handle() [3/3]

async Task<HttpResponseMessage> Handle ( string  parameters,
string  authorizationHeaderValue 
)
inline

Handle a token request to a token endpoint. This method calls Authlete's /api/auth/token API and conditionally /api/auth/token/issue API or /api/token/issue/fail API.

Since version 1.0.3

Returns
An HTTP response that should be returned from the token endpoint implementation to the client application.
Parameters
parametersForm parameters of the token request in application/x-www-form-urlencoded format. The value can be obtained by calling HttpRequestMessage.Content.ReadAsStringAsync.
Parameters
authorizationHeaderValueThe value of the Authorization header of the token request. The value can be obtained by calling HttpRequestMessage.Headers.Authorization. Note that token requests don't always have an Authorization header.
Exceptions
AuthleteApiException

The documentation for this class was generated from the following file: