Interface IAuthTokenProvider
A provider that returns an auth token.
Namespace: anybill.POS.Client.Authentication
Assembly: anybill.POS.Client.Abstractions.dll
Syntax
public interface IAuthTokenProvider
Remarks
This can be a stateful class and should therefore be used with care.
Methods
GetAsync(Boolean, CancellationToken)
Returns an auth token.
Declaration
Task<string> GetAsync(bool reAuthenticate, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | reAuthenticate | Whether to reset the state. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | An auth token. |
Remarks
Can be used to test authentication. Set reAuthenticate
to reset the state.
Exceptions
Type | Condition |
---|---|
AuthenticationException | If an error occured while authentication. |
GetAsync(CancellationToken)
Returns an auth token.
Declaration
Task<string> GetAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | An auth token. |
Remarks
Can be used to test authentication.
Exceptions
Type | Condition |
---|---|
AuthenticationException | If an error occured while authentication. |