Class StaticAuthTokenProvider
- Namespace
- anybill.POS.Client.Authentication
- Assembly
- anybill.POS.Client.dll
A static auth token provider.
public class StaticAuthTokenProvider : IAuthTokenProvider
- Inheritance
-
StaticAuthTokenProvider
- Implements
- Inherited Members
Remarks
Should only be used for testing purposes.
Constructors
StaticAuthTokenProvider(string)
Creates a new instance.
public StaticAuthTokenProvider(string authToken)
Parameters
authToken
stringThe auth token to use.
Methods
GetAsync(bool, CancellationToken)
Returns an auth token.
public Task<string> GetAsync(bool reAuthenticate, CancellationToken cancellationToken)
Parameters
reAuthenticate
boolWhether to reset the state.
cancellationToken
CancellationTokenThe cancellation token.
Returns
Remarks
Can be used to test authentication. Set reAuthenticate
to reset the state.
Exceptions
- AuthenticationException
If an error occured while authentication.
GetAsync(CancellationToken)
Returns an auth token.
public Task<string> GetAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenThe cancellation token.
Returns
Remarks
Can be used to test authentication.
Exceptions
- AuthenticationException
If an error occured while authentication.
SetToken(string)
Sets a new auth token.
public void SetToken(string authToken)
Parameters
authToken
stringThe auth token to use.