Class HttpPkceRequestHandler
Handles all HTTP requests required in the Proof Key Code Exchange authentication flow.
Inherited Members
Namespace: Unity.Cloud.Identity
Syntax
public class HttpPkceRequestHandler : IPkceRequestHandler
Constructors
HttpPkceRequestHandler(IHttpClient, IPkceConfigurationProvider)
Creates a HttpPkceRequestHandler that handles all HTTP requests required in the Proof Key Code Exchange authentication flow.
Declaration
public HttpPkceRequestHandler(IHttpClient httpClient, IPkceConfigurationProvider pkceConfigurationProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IHttpClient | httpClient | The IHttpClient instance required to make HTTP requests. |
| IPkceConfigurationProvider | pkceConfigurationProvider | The IPkceConfigurationProvider instance used to fetch the PkceConfiguration holding endpoints url. |
Methods
ExchangeCodeForDeviceTokenAsync(String)
Creates a task that sends an HTTP request to the TokenUrl to exchange a code for a DeviceToken.
Declaration
public async Task<DeviceToken> ExchangeCodeForDeviceTokenAsync(string tokenEndPointParams)
Parameters
| Type | Name | Description |
|---|---|---|
| String | tokenEndPointParams | The application/x-www-form-urlencoded string value that holds all parameters required to reach the TokenUrl endpoint. |
Returns
| Type | Description |
|---|---|
| Task<DeviceToken> | A task that results in a DeviceToken when completed. |
Implements
GetAuthenticatedUserInfoAsync(String)
Returns the authenticated user information from the PKCEConfiguration /userinfo endpoint.
Declaration
public async Task<IAuthenticatedUserInfoProvider> GetAuthenticatedUserInfoAsync(string accessToken)
Parameters
| Type | Name | Description |
|---|---|---|
| String | accessToken | The access token delivered by the PKCE identity provider. |
Returns
| Type | Description |
|---|---|
| Task<IAuthenticatedUserInfoProvider> | A task that results in a IAuthenticatedUserInfoProvider when completed. |
Implements
RefreshTokenAsync(String, String)
Creates a task that sends an HTTP request to the RefreshTokenUrl to refresh the current DeviceToken.
Declaration
public async Task<DeviceToken> RefreshTokenAsync(string tokenEndPointParams, string refreshToken)
Parameters
| Type | Name | Description |
|---|---|---|
| String | tokenEndPointParams | The application/x-www-form-urlencoded string value that holds all parameters required to reach the RefreshTokenUrl endpoint. |
| String | refreshToken | The refresh token string value to persist if no refresh token value is returned from RefreshTokenUrl endpoint. |
Returns
| Type | Description |
|---|---|
| Task<DeviceToken> | A task that results in a DeviceToken when completed. |
Implements
RevokeRefreshTokenAsync(String)
Creates a Task that sends an HTTP request to the LogoutUrl to revoke the current DeviceToken.
Declaration
public async Task RevokeRefreshTokenAsync(string revokeEndPointParams)
Parameters
| Type | Name | Description |
|---|---|---|
| String | revokeEndPointParams | The application/x-www-form-urlencoded string value that holds all parameters required to reach the LogoutUrl endpoint. |
Returns
| Type | Description |
|---|---|
| Task | A task. |