Handler for token requests to a token endpoint of OAuth 2.0 (RFC 6749).
More...
|
| 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...
|
|
|
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...
|
|
Handler for token requests to a token endpoint of OAuth 2.0 (RFC 6749).
◆ TokenRequestHandler()
Constructor.
- Parameters
-
api | An implementation of the IAuthleteApi interface. |
- Parameters
-
spi | An implementation of the Service Provider Interface. It is the customization point. |
◆ 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
-
parameters | Form parameters of the token request in application/x-www-form-urlencoded format. The value can be obtained by calling HttpRequestMessage.Content.ReadAsStringAsync . |
- Parameters
-
authorization | The 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
-
◆ 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
-
parameters | Form parameters of the token request in application/x-www-form-urlencoded format. The value can be obtained by calling HttpRequestMessage.Content.ReadAsStringAsync . |
- Parameters
-
credentials | The pair of client ID and client secret that might be embedded in the Authorization header of the token request. |
- Exceptions
-
◆ 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
-
parameters | Form parameters of the token request in application/x-www-form-urlencoded format. The value can be obtained by calling HttpRequestMessage.Content.ReadAsStringAsync . |
- Parameters
-
authorizationHeaderValue | The 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
-
The documentation for this class was generated from the following file:
- Authlete/Handler/TokenRequestHandler.cs