Show / Hide Table of Contents

# Class StaticAuthTokenProvider

A static auth token provider.

##### Inheritance

System.Object
StaticAuthTokenProvider

##### Implements

IAuthTokenProvider

###### Namespace: anybill.POS.Client.Authentication

###### Assembly: anybill.POS.Client.dll

##### Syntax

    public class StaticAuthTokenProvider : IAuthTokenProvider

##### Remarks

Should only be used for testing purposes.

### Constructors

#### StaticAuthTokenProvider(String)

Creates a new instance.

##### Declaration

    public StaticAuthTokenProvider(string authToken)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | authToken | The auth token to use.

### Methods

#### GetAsync(Boolean, CancellationToken)

Returns an auth token.

##### Declaration

    public 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

    public 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.

#### SetToken(String)

Sets a new auth token.

##### Declaration

    public void SetToken(string authToken)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | authToken | The auth token to use.

### Implements

IAuthTokenProvider