Table of Contents

Class StaticCredentialsProvider

Namespace
DynaSharp.Credentials
Assembly
DynaSharp.dll

Always supplies the same credentials. Use for long-term keys, tests and DynamoDB Local.

public sealed class StaticCredentialsProvider : ICredentialsProvider
Inheritance
StaticCredentialsProvider
Implements
Inherited Members

Constructors

StaticCredentialsProvider(AwsCredentials)

Always supplies the same credentials. Use for long-term keys, tests and DynamoDB Local.

public StaticCredentialsProvider(AwsCredentials credentials)

Parameters

credentials AwsCredentials

The credentials to supply.

StaticCredentialsProvider(string, string, string?)

Initializes a new instance of the StaticCredentialsProvider class from the parts of the credentials, for the common case of a key pair that is not temporary or whose token comes from a configuration source.

public StaticCredentialsProvider(string accessKeyId, string secretAccessKey, string? sessionToken = null)

Parameters

accessKeyId string

The access key id, for example AKIAIOSFODNN7EXAMPLE.

secretAccessKey string

The secret access key.

sessionToken string

The session token of temporary credentials, or null for long-term keys. This provider never refreshes: temporary credentials stop working when they expire.

Exceptions

ArgumentException

accessKeyId or secretAccessKey is null or empty.

Methods

GetCredentialsAsync(CancellationToken)

Gets the current credentials.

public ValueTask<AwsCredentials> GetCredentialsAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Cancels a pending credential lookup.

Returns

ValueTask<AwsCredentials>

The credentials.

Exceptions

CredentialsUnavailableException

No credentials can be found.