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.
Temporary, short-lived session credentials that are automatically retrieved from Amazon Cognito Identity Service and AWS Security Token Service. Depending on configured Logins, credentials may be authenticated or unauthenticated.
Namespace: Amazon.CognitoIdentity
Assembly: AWSSDK.CognitoIdentity.dll
Version: 3.x.y.z
public class CognitoAWSCredentials : RefreshingAWSCredentials IDisposable
The CognitoAWSCredentials type exposes the following members
Name | Description | |
---|---|---|
CognitoAWSCredentials(string, RegionEndpoint) |
Constructs a new CognitoAWSCredentials instance, which will use the specified Amazon Cognito identity pool to get short lived session credentials. |
|
CognitoAWSCredentials(string, string, string, string, RegionEndpoint) |
Constructs a new CognitoAWSCredentials instance, which will use the specified Amazon Cognito identity pool to make a requests to the AWS Security Token Service (STS) to request short lived session credentials. |
|
CognitoAWSCredentials(string, string, string, string, IAmazonCognitoIdentity, IAmazonSecurityTokenService) |
Constructs a new CognitoAWSCredentials instance, which will use the specified Amazon Cognito identity pool to make a requests to the AWS Security Token Service (STS) to request short lived session credentials. |
Name | Type | Description | |
---|---|---|---|
AccountId | System.String |
The AWS accountId for the account with Amazon Cognito |
|
AuthRoleArn | System.String |
The ARN of the IAM Role that will be assumed when authenticated |
|
CurrentLoginProviders | System.String[] |
The list of current providers that are used for authenticated credentials. |
|
IdentityPoolId | System.String |
The Amazon Cogntio identity pool to use |
|
LoginsCount | System.Int32 |
Returns count of Login Providers. |
|
PreemptExpiryTime | System.TimeSpan | Inherited from Amazon.Runtime.RefreshingAWSCredentials. | |
UnAuthRoleArn | System.String |
The ARN of the IAM Role that will be assumed when unauthenticated |
Name | Description | |
---|---|---|
AddLogin(string, string) |
Adds a login to be used for authenticated requests. |
|
CacheCredentials(RefreshingAWSCredentials.CredentialsRefreshState) |
Caches the credentials to player pref's |
|
CacheIdentityId(string) |
Caches the identity id retrieved from Cognito. For the Windows Phone and Windows Store version of the SDK the identity id is stored in the Windows.Storage.ApplicationData.Current.LocalSettings or Windows.Storage.ApplicationData.Current.RoamingSettings depending on the IdentityIdCacheMode property. For the base .NET 3.5 and .NET 4.5 version of the SDK the identity id is not cached. To support caching the CacheIdentityId, GetCachedIdentityId and ClearIdentityCache methods need to be overridden. |
|
Clear() |
Clears current credentials state. This will reset the IdentityId. Use Amazon.Runtime.RefreshingAWSCredentials.ClearCredentials instead if you just want to trigger a credentials refresh. |
|
ClearCredentials() | Inherited from Amazon.Runtime.RefreshingAWSCredentials. | |
ClearIdentityCache() |
Clears the currently identity id from the cache. For the base .NET 3.5 and .NET 4.5 version of the SDK the identity id is not cached. To support caching the CacheIdentityId, GetCachedIdentityId and ClearIdentityCache methods need to be overridden. |
|
ContainsProvider(string) |
Returns if the providerName is present in the Logins Collection. |
|
Dispose() | Inherited from Amazon.Runtime.RefreshingAWSCredentials. | |
GetCachedCredentials() |
Gets the cached credentials state |
|
GetCachedIdentityId() |
Gets the previously cached the identity id retrieved from Cognito. For the Windows Phone and Windows Store version of the SDK the identity id is stored in the Windows.Storage.ApplicationData.Current.LocalSettings or Windows.Storage.ApplicationData.Current.RoamingSettings depending on the IdentityIdCacheMode property. By default IdentityIdCacheMode will be set LocalSettings. For the base .NET 3.5 and .NET 4.5 version of the SDK the identity id is not cached. To support caching the CacheIdentityId, GetCachedIdentityId and ClearIdentityCache methods need to be overridden. |
|
GetCredentials() | Inherited from Amazon.Runtime.RefreshingAWSCredentials. | |
GetCredentialsAsync() | Inherited from Amazon.Runtime.RefreshingAWSCredentials. | |
GetIdentityId() |
Gets the Identity Id corresponding to the credentials retrieved from Cognito. Note: this setting may change during execution. To be notified of its new value, attach a listener to IdentityChangedEvent |
|
GetIdentityIdAsync() |
Gets the Identity Id corresponding to the credentials retrieved from Cognito. Note: this setting may change during execution. To be notified of its new value, attach a listener to IdentityChangedEvent |
|
RefreshIdentityAsync() |
Provides a way to override fetching the identity in case of developer authenticated identities. The default behaviour will be using Cognito to retrieve the identity id. |
|
RemoveLogin(string) |
Removes a provider from the collection of logins. |
Name | Description | |
---|---|---|
IdentityChangedEvent |
.NET Core App:
Supported in: 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5, 4.0, 3.5