AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Credentials that are retrieved using a stored profile.

Unless otherwise specified priority is given to loading credentials from the SDK credential store file which is shared between the SDK, PowerShell CLI and Toolkit. Credentials in profiles in this file are encrypted and can only be used by the user account on the current machine that stored the profile. Credentials can also be loaded from the plain-text ini-format credential file which is shared with other AWS SDKs. This file is expected to exist in a '.aws' folder in the user's home directory but alternate locations can be specified using either the AWSProfilesLocation setting in the application configuration file, or by using the AWS_SHARED_CREDENTIALS_FILE environment variable.

The profile name can be specified in the App.config using the AWSProfileName setting.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AWSCredentials
    Amazon.Runtime.StoredProfileAWSCredentials

Namespace: Amazon.Runtime
Assembly: AWSSDK.Core.dll
Version: 3.x.y.z

Syntax

C#
[Obsolete("This class is obsolete and will be removed in a future release. Please use Amazon.Runtime.CredentialManagement.NetSDKCredentialsFile or SharedCredentialsFile..  Visit http://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html for further details.")]
public class StoredProfileAWSCredentials : AWSCredentials

The StoredProfileAWSCredentials type exposes the following members

Constructors

NameDescription
Public Method StoredProfileAWSCredentials()

Constructs an instance for credentials stored in a profile. This constructor searches for credentials using the account name specified using the AWSProfileName setting, if set, in the application configuration file. If the configuration file setting is not set the SDK will attempt to locate a profile with the name 'default'.

Public Method StoredProfileAWSCredentials(string)

Constructs an instance for credentials stored in a profile with the specified name. The SDK will check the SDK credential store file first before looking for the shared ini-format credentials file unless the application configuration file contains a setting for the 'AWSProfilesLocation' indicating the search should be constrained to the shared credentials file at the specified location.

Public Method StoredProfileAWSCredentials(string, string)

Constructs an instance for credentials stored in a profile with the specified name.

Properties

NameTypeDescription
Public Property ProfileName System.String

Name of the profile being used.

Public Property ProfilesLocation System.String

Location of the profiles, if used.

Public Property WrappedCredentials Amazon.Runtime.AWSCredentials

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method Static Method CanCreateFrom(string, string)

Tests if an instance can be created from the persisted profile data. If profilesLocation is null/empty, the SDK store is searched for the profile data before probing for the profile in the shared the ini-format credential file.

Public Method GetCredentials()

Returns an instance of ImmutableCredentials for this instance

Public Method GetCredentialsAsync() Inherited from Amazon.Runtime.AWSCredentials.
Public Method Static Method IsProfileKnown(string, string)

Tests if a profile has been registered in either the SDK store or the specified credential file.

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5