C# Class Amazon.CognitoIdentity.CognitoAWSCredentials

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.
Inheritance: Amazon.Runtime.RefreshingAWSCredentials
Mostrar archivo Open project: aws/aws-sdk-net Class Usage Examples

Public Methods

Method Description
CacheIdentityId ( string identityId ) : void

Caches the identity id retrieved from Cognito.

For Unity, the Identity id is stored in PlayerPrefs property.

ClearIdentityCache ( ) : void

Clears the currently identity id from the cache.

GetCachedIdentityId ( ) : string

Gets the previously cached the identity id retrieved from Cognito. For Unity, the Identity id is stored in PlayerPrefs

GetCredentialsAsync ( AmazonCognitoIdentityCallback callback, AsyncOptions options = null ) : void

Returns an instance of ImmutableCredentials for this instance

GetIdentityIdAsync ( AmazonCognitoIdentityCallback callback, AsyncOptions options = null ) : void

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

Private Methods

Method Description
CacheCredentials ( CredentialsRefreshState credentialsState ) : void

Caches the credentials to player pref's

GetCachedCredentials ( ) : CredentialsRefreshState

Gets the cached credentials state

GetCredentialsForIdentity ( GetCredentialsForIdentityRequest getCredentialsRequest ) : Amazon.CognitoIdentity.Model.GetCredentialsForIdentityResponse
GetOpenId ( Amazon.CognitoIdentity.Model.GetOpenIdTokenRequest getTokenRequest ) : GetOpenIdTokenResponse
GetStsCredentials ( AssumeRoleWithWebIdentityRequest assumeRequest ) : Credentials

Method Details

CacheIdentityId() public method

Caches the identity id retrieved from Cognito.

For Unity, the Identity id is stored in PlayerPrefs property.

public CacheIdentityId ( string identityId ) : void
identityId string The Cognito identity id to cache
return void

ClearIdentityCache() public method

Clears the currently identity id from the cache.
public ClearIdentityCache ( ) : void
return void

GetCachedIdentityId() public method

Gets the previously cached the identity id retrieved from Cognito. For Unity, the Identity id is stored in PlayerPrefs
public GetCachedIdentityId ( ) : string
return string

GetCredentialsAsync() public method

Returns an instance of ImmutableCredentials for this instance
public GetCredentialsAsync ( AmazonCognitoIdentityCallback callback, AsyncOptions options = null ) : void
callback AmazonCognitoIdentityCallback The callback which is executed when the asynchronous operations is completed
options Amazon.Runtime.AsyncOptions Options for executing asynchronous operation
return void

GetIdentityIdAsync() public method

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
public GetIdentityIdAsync ( AmazonCognitoIdentityCallback callback, AsyncOptions options = null ) : void
callback AmazonCognitoIdentityCallback The callback which is executed when the asynchronous operations is completed
options Amazon.Runtime.AsyncOptions Options for executing asynchronous operation
return void