Class StaticTokenProvider
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
stringBearer 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 retrievetoken
afterexpiration
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