Class HttpPkceRequestHandler
Handles all HTTP requests required in the Proof Key Code Exchange authentication flow.
Implements
Inherited Members
Namespace: Unity.Cloud.Identity
Assembly: Unity.Cloud.Identity.dll
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 Unity.Cloud.Common.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 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. |
GetUserInfoAsync(string)
Returns the user information claims from the PKCEConfiguration /userinfo endpoint.
Declaration
public Task<string> GetUserInfoAsync(string userInfoClaim)
Parameters
Type | Name | Description |
---|---|---|
string | userInfoClaim |
Returns
Type | Description |
---|---|
Task<string> | A task that results in the string value of the userInfo claims when completed. |
RefreshTokenAsync(string, string)
Creates a task that sends an HTTP request to the RefreshTokenUrl to refresh the current DeviceToken.
Declaration
public 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. |
RevokeRefreshTokenAsync(string)
Creates a Task that sends an HTTP request to the LogoutUrl to revoke the current DeviceToken.
Declaration
public 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. |