Interface IDeviceOAuth2Stepwise
Interface for device based OAuth2 flow that does not use event callbacks.
Inherited Members
Namespace: DeviceOAuth2
Assembly: DeviceOAuth2.dll
Syntax
public interface IDeviceOAuth2Stepwise : IDeviceOAuthInfo
Methods
| Improve this Doc View SourceRefreshAccessToken(TokenInfo)
Refreshes an access token if supported.
Declaration
Task<TokenInfo> RefreshAccessToken(TokenInfo token)
Parameters
Type | Name | Description |
---|---|---|
TokenInfo | token | The token to refresh |
Returns
Type | Description |
---|---|
Task<TokenInfo> | Refreshed token |
RefreshAccessToken(TokenInfo, CancellationToken)
Refreshes an access token if supported.
Declaration
Task<TokenInfo> RefreshAccessToken(TokenInfo token, CancellationToken cancelToken)
Parameters
Type | Name | Description |
---|---|---|
TokenInfo | token | The token to refresh |
CancellationToken | cancelToken |
Returns
Type | Description |
---|---|
Task<TokenInfo> | Refreshed token |
StartAuthorization()
Begins the authorization workflow by getting a device and user code from the endpoint.
Declaration
Task<AuthInfo> StartAuthorization()
Returns
Type | Description |
---|---|
Task<AuthInfo> | An AuthInfo. The user should be presented the VerificationUri and UserCode as well as instruction on what to do with them. This object should then be passed to WaitForUserConsent(AuthInfo). |
StartAuthorization(CancellationToken)
Begins the authorization workflow by getting a device and user code from the endpoint.
Declaration
Task<AuthInfo> StartAuthorization(CancellationToken cancelToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancelToken |
Returns
Type | Description |
---|---|
Task<AuthInfo> | An AuthInfo. The user should be presented the VerificationUri and UserCode as well as instruction on what to do with them. This object should then be passed to WaitForUserConsent(AuthInfo, CancellationToken) |
WaitForUserConsent(AuthInfo)
Polls the oauth endpoint until: 1) The user authorizes access 2) The user denies access 3) The authorization times out (endpoint specific)
Declaration
Task<TokenInfo> WaitForUserConsent(AuthInfo info)
Parameters
Type | Name | Description |
---|---|---|
AuthInfo | info | The AuthInfo returned from StartAuthorization() |
Returns
Type | Description |
---|---|
Task<TokenInfo> | A TokenInfo that contains the Access Token |
WaitForUserConsent(AuthInfo, CancellationToken)
Polls the oauth endpoint until: 1) The user authorizes access 2) The user denies access 3) The authorization times out (endpoint specific)
Declaration
Task<TokenInfo> WaitForUserConsent(AuthInfo info, CancellationToken cancelToken)
Parameters
Type | Name | Description |
---|---|---|
AuthInfo | info | The AuthInfo returned from StartAuthorization(CancellationToken) |
CancellationToken | cancelToken |
Returns
Type | Description |
---|---|
Task<TokenInfo> | A TokenInfo that contains the Access Token |