• Home
  • Documentation
Show / Hide Table of Contents
  • anybill.POS.Client
    • IAnybillClient
  • anybill.POS.Client.Authentication
    • DefaultAuthTokenProvider
    • IAuthTokenProvider
    • StaticAuthTokenProvider
  • anybill.POS.Client.Exceptions
    • AnybillApiException
    • AuthenticationException
    • BadRequestException
    • ForbiddenException
    • NotFoundException
    • UnauthorizedException
    • UnhandledException
    • UserNotFoundException
  • anybill.POS.Client.Extensions.Microsoft.DependencyInjection
    • ServiceCollectionExtensions
  • anybill.POS.Client.Factories
    • AnybillClientFactory
    • IAnybillClientFactory
  • anybill.POS.Client.Models.Bill
    • AddBill
    • AddBillOptions
    • Bill
    • BillDisplayTarget
    • BuyerInfo
    • Gender
    • RegisterBillId
    • UserIdentification
  • anybill.POS.Client.Models.Bill.CashRegister
    • CashRegister
  • anybill.POS.Client.Models.Bill.Data
    • Data
  • anybill.POS.Client.Models.Bill.Data.Extension
    • AnybillDataExtension
  • anybill.POS.Client.Models.Bill.Data.Extension.Discount
    • BillDiscount
    • BillDiscountBarcodeType
    • BillDiscountType
  • anybill.POS.Client.Models.Bill.Data.Extension.Discount.VatAmount
    • BillDiscountVatAmount
  • anybill.POS.Client.Models.Bill.Data.Line
    • DefaultLine
    • ILine
    • LineBase
  • anybill.POS.Client.Models.Bill.Data.Line.Extension
    • AnybillDefaultLineExtension
    • AnybillDiscountLineExtension
    • AnybillLineBaseExtension
    • AnybillTextLineExtension
    • DefaultLineDiscount
    • DiscountLine
    • TextLine
  • anybill.POS.Client.Models.Bill.Data.Line.Extension.VatAmount
    • DiscountLineVatAmount
    • LineDiscountVatAmount
  • anybill.POS.Client.Models.Bill.Data.Line.Item
    • Item
    • QuantityMeasure
  • anybill.POS.Client.Models.Bill.Data.Line.Item.Extension
    • AnybillItemExtension
  • anybill.POS.Client.Models.Bill.Data.Line.Item.Extension.Warranty
    • Warranty
  • anybill.POS.Client.Models.Bill.Data.Line.Item.Extension.Warranty.Reminder
    • Reminder
  • anybill.POS.Client.Models.Bill.Data.Line.VatAmount
    • LineVatAmount
  • anybill.POS.Client.Models.Bill.Data.PaymentType
    • PaymentTypeInformation
  • anybill.POS.Client.Models.Bill.Data.PaymentType.Extension
    • AnybillPaymentTypeInformationExtension
    • PaymentType
  • anybill.POS.Client.Models.Bill.Data.PaymentType.Extension.PaymentDetails
    • BankTransferPaymentDetails
    • CardPaymentDetails
    • CashPaymentDetails
    • CheckPaymentDetails
    • CreditCardPaymentDetails
    • DirectDebitPaymentDetails
    • GiftCardPaymentDetails
    • LoyaltyCardPaymentDetails
    • OnlinePaymentDetails
    • PaymentDetails
  • anybill.POS.Client.Models.Bill.Data.VatAmount
    • DataVatAmount
  • anybill.POS.Client.Models.Bill.Head
    • Head
  • anybill.POS.Client.Models.Bill.Head.Buyer
    • Buyer
  • anybill.POS.Client.Models.Bill.Head.Buyer.Address
    • BuyerAddress
  • anybill.POS.Client.Models.Bill.Head.Extension
    • AnybillHeadExtension
  • anybill.POS.Client.Models.Bill.Head.Seller
    • Seller
  • anybill.POS.Client.Models.Bill.Head.Seller.Address
    • SellerAddress
  • anybill.POS.Client.Models.Bill.Misc
    • Misc
  • anybill.POS.Client.Models.Bill.Misc.AdditionalReceipt
    • AdditionalReceipt
  • anybill.POS.Client.Models.Bill.Misc.Extension
    • AnybillMiscExtension
    • ReturnBarcodeType
  • anybill.POS.Client.Models.Bill.Misc.Extension.AfterSalesCoupon
    • AfterSalesCoupon
    • AfterSalesCouponCodeType
  • anybill.POS.Client.Models.Bill.Misc.Extension.CustomSection
    • CustomSection
    • CustomSectionPosition
    • CustomSectionType
  • anybill.POS.Client.Models.Bill.Misc.Extension.CustomSection.CustomSectionData
    • BarcodeCustomSectionData
    • CustomSectionDataAlignment
    • CustomSectionDataBase
    • DividerCustomSectionData
    • ICustomSectionData
    • KeyValueCustomSectionData
    • QrCodeCustomSectionData
    • TextCustomSectionData
  • anybill.POS.Client.Models.Bill.Misc.Logo
    • Logo
  • anybill.POS.Client.Models.Bill.Response
    • IBillResponse
    • IExternalIdResponse
    • ILoyaltyCardResponse
    • IMatchedBillResponse
    • IRegisterBillIdExternalIdResponse
    • IRegisterBillIdResponse
    • IRegisterBillIdUrlResponse
    • IUrlBillResponse
    • IUserIdResponse
  • anybill.POS.Client.Models.Bill.Security
    • Security
  • anybill.POS.Client.Models.Bill.Security.Extension
    • AnybillSecurityExtension
  • anybill.POS.Client.Models.Bill.Security.Tse
    • Rksv
    • Tse
    • TseBase
  • anybill.POS.Client.Models.Bill.Security.Tse.Extension
    • AnybillTseExtension
  • anybill.POS.Client.Models.Bill.Security.Tse.Extension.AdditionalTseData
    • AdditionalRksvData
    • AdditionalTseData
  • anybill.POS.Client.Models.Category.Response
    • ICategoryResponse
  • anybill.POS.Client.Models.Customer.Response
    • ICustomerActivatedNotActivatedResponse
    • ICustomerActivatedResponse
    • ICustomerResponse
  • anybill.POS.Client.Models.Onboarding
    • Address
    • BillingAddress
    • Onboarding
    • OnboardingCreateStore
    • OnboardingCreateStoreDetail
    • OnboardingCreateVendorCustomer
    • StoreOpeningHours
  • anybill.POS.Client.Models.Onboarding.Response
    • IOnboardingResponse
    • OnboardingStore
    • VendorApiUser
  • anybill.POS.Client.Models.Store
    • Address
    • BillCreationType
    • StoreBillCreationInformation
    • StoreOpeningHours
    • UpSertStore
  • anybill.POS.Client.Models.Store.Response
    • Address
    • BillCreationType
    • IDeleteStoreResponse
    • IStoreHistoryResponse
    • IStoreResponse
    • StoreBillCreationInformation
    • StoreOpeningHours
  • anybill.POS.Client.Models.User
    • UserIdentification
  • anybill.POS.Client.Models.User.Response
    • IUserIdentificationResponse
  • anybill.POS.Client.Modules
    • IAnybillClientAuthModule
    • IAnybillClientBillModule
    • IAnybillClientCategoryModule
    • IAnybillClientCustomerModule
    • IAnybillClientOnboardingModule
    • IAnybillClientStoreModule
    • IAnybillClientUserModule
  • anybill.POS.Client.Newtonsoft
    • AnybillClientFactoryExtensions
    • NewtonsoftAnybillAuthenticationSerializer
    • NewtonsoftAnybillSerializer
    • NewtonsoftAnybillSerializerBase
  • anybill.POS.Client.Options
    • AnybillAuthenticationOptionsBuilder
    • AnybillEnvironment
    • IAnybillAuthenticationOptions
    • IAnybillClientOptions
    • IAnybillEnvironmentOptions
    • IDefaultAuthTokenProviderOptions
  • anybill.POS.Client.Requests
    • AnybillRequestBase
  • anybill.POS.Client.Serialization
    • DefaultAnybillAuthenticationSerializer
    • DefaultAnybillSerializer
    • DefaultAnybillSerializerBase
    • IAnybillSerializer

Class DefaultAuthTokenProvider

The default authentication token provider.

Inheritance
System.Object
DefaultAuthTokenProvider
Implements
IAuthTokenProvider
Namespace: anybill.POS.Client.Authentication
Assembly: anybill.POS.Client.dll
Syntax
public class DefaultAuthTokenProvider : IAuthTokenProvider

Constructors

DefaultAuthTokenProvider(IAnybillAuthenticationOptions)

Creates a new instance with minimum configuration.

Declaration
public DefaultAuthTokenProvider(IAnybillAuthenticationOptions anybillAuthenticationOptions)
Parameters
Type Name Description
IAnybillAuthenticationOptions anybillAuthenticationOptions

The authentication options to use.

Exceptions
Type Condition
System.ArgumentException

If anybillAuthenticationOptions is null.

DefaultAuthTokenProvider(IAnybillAuthenticationOptions, IDefaultAuthTokenProviderOptions, IAnybillSerializer, HttpClient, ILogger<DefaultAuthTokenProvider>)

Creates a new instance.

Declaration
public DefaultAuthTokenProvider(IAnybillAuthenticationOptions anybillAuthenticationOptions, IDefaultAuthTokenProviderOptions defaultAuthTokenProviderOptions, IAnybillSerializer anybillSerializer, HttpClient httpClient, ILogger<DefaultAuthTokenProvider> logger)
Parameters
Type Name Description
IAnybillAuthenticationOptions anybillAuthenticationOptions

The authentication options to use.

IDefaultAuthTokenProviderOptions defaultAuthTokenProviderOptions

The custom auth service options to use.

IAnybillSerializer anybillSerializer

The IAnybillSerializer to use.

System.Net.Http.HttpClient httpClient

The http client to use.

Microsoft.Extensions.Logging.ILogger<DefaultAuthTokenProvider> logger

The logger to use

Exceptions
Type Condition
System.ArgumentException

If anybillAuthenticationOptions is null.

DefaultAuthTokenProvider(IAnybillAuthenticationOptions, IDefaultAuthTokenProviderOptions, ILogger<DefaultAuthTokenProvider>)

Creates a new instance.

Declaration
public DefaultAuthTokenProvider(IAnybillAuthenticationOptions anybillAuthenticationOptions, IDefaultAuthTokenProviderOptions defaultAuthTokenProviderOptions, ILogger<DefaultAuthTokenProvider> logger)
Parameters
Type Name Description
IAnybillAuthenticationOptions anybillAuthenticationOptions

The authentication options to use.

IDefaultAuthTokenProviderOptions defaultAuthTokenProviderOptions

The custom auth service options to use.

Microsoft.Extensions.Logging.ILogger<DefaultAuthTokenProvider> logger

The logger to use

Exceptions
Type Condition
System.ArgumentException

If anybillAuthenticationOptions is null.

DefaultAuthTokenProvider(IAnybillAuthenticationOptions, IDefaultAuthTokenProviderOptions, HttpClient, ILogger<DefaultAuthTokenProvider>)

Creates a new instance.

Declaration
public DefaultAuthTokenProvider(IAnybillAuthenticationOptions anybillAuthenticationOptions, IDefaultAuthTokenProviderOptions defaultAuthTokenProviderOptions, HttpClient httpClient, ILogger<DefaultAuthTokenProvider> logger)
Parameters
Type Name Description
IAnybillAuthenticationOptions anybillAuthenticationOptions

The authentication options to use.

IDefaultAuthTokenProviderOptions defaultAuthTokenProviderOptions

The custom auth service options to use.

System.Net.Http.HttpClient httpClient

The http client to use.

Microsoft.Extensions.Logging.ILogger<DefaultAuthTokenProvider> logger

The logger to use

Exceptions
Type Condition
System.ArgumentException

If anybillAuthenticationOptions is null.

DefaultAuthTokenProvider(IAnybillAuthenticationOptions, ILogger<DefaultAuthTokenProvider>)

Creates a new instance.

Declaration
public DefaultAuthTokenProvider(IAnybillAuthenticationOptions anybillAuthenticationOptions, ILogger<DefaultAuthTokenProvider> logger)
Parameters
Type Name Description
IAnybillAuthenticationOptions anybillAuthenticationOptions

The authentication options to use.

Microsoft.Extensions.Logging.ILogger<DefaultAuthTokenProvider> logger

The logger to use

Exceptions
Type Condition
System.ArgumentException

If anybillAuthenticationOptions is null.

DefaultAuthTokenProvider(IAnybillAuthenticationOptions, HttpClient, ILogger<DefaultAuthTokenProvider>)

Creates a new instance.

Declaration
public DefaultAuthTokenProvider(IAnybillAuthenticationOptions anybillAuthenticationOptions, HttpClient httpClient, ILogger<DefaultAuthTokenProvider> logger)
Parameters
Type Name Description
IAnybillAuthenticationOptions anybillAuthenticationOptions

The authentication options to use.

System.Net.Http.HttpClient httpClient

The http client to use.

Microsoft.Extensions.Logging.ILogger<DefaultAuthTokenProvider> logger

The logger to use

Exceptions
Type Condition
System.ArgumentException

If anybillAuthenticationOptions is null.

Methods

GetAsync(Boolean, CancellationToken)

Returns an auth token.

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

SetAnybillAuthenticationOptions(IAnybillAuthenticationOptions)

Updates the current authentication options.

Declaration
public void SetAnybillAuthenticationOptions(IAnybillAuthenticationOptions anybillAuthenticationOptions)
Parameters
Type Name Description
IAnybillAuthenticationOptions anybillAuthenticationOptions

The updated authentication options to use.

Remarks

Resets the current cached authentication token.

UseCustomSerializer(IAnybillSerializer)

Use a custom serializer.

Declaration
public void UseCustomSerializer(IAnybillSerializer anybillSerializer)
Parameters
Type Name Description
IAnybillSerializer anybillSerializer

The custom serializer.

Implements

IAuthTokenProvider
In This Article
Back to top Generated by DocFX