Table of Contents

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 string

The auth token to use.

Methods

GetAsync(bool, CancellationToken)

Returns an auth token.

public Task<string> GetAsync(bool reAuthenticate, CancellationToken cancellationToken)

Parameters

reAuthenticate bool

Whether to reset the state.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<string>

An auth token.

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 CancellationToken

The cancellation token.

Returns

Task<string>

An auth token.

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 string

The auth token to use.