Table of Contents

Class StaticTokenProvider

Namespace
Amazon.Runtime
Assembly
AWSSDK.Core.dll
public class StaticTokenProvider : IAWSTokenProvider
Inheritance
StaticTokenProvider
Implements
Inherited Members

Constructors

StaticTokenProvider(string, DateTime?)

Creates a new StaticTokenProvider that can be assigned to AWSTokenProvider or added to a AWSTokenProviderChain.

public StaticTokenProvider(string token, DateTime? expiration = null)

Parameters

token string

Bearer token to use to authorize AWS SDK requests.

expiration DateTime?

An optional DateTime in UTC for which token will no longer be valid. Attempting to retrieve token after expiration will cause a AmazonClientException to be thrown.

Methods

TryResolveTokenAsync(CancellationToken)

Attempts to load an AWSToken.

NOTE: In some extreme circumstances, providers may throw an exception.
public Task<TryResponse<AWSToken>> TryResolveTokenAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<TryResponse<AWSToken>>