src/AWSSDK.Extensions.CognitoAuthentication/CognitoUserAuthentication.cs
/// <summary>
/// Creates the CognitoAWSCredentials for accessing AWS resources. Should only be called with an authenticated user.
/// </summary>
/// <param name="identityPoolID">The poolID of the identity pool the user belongs to</param>
/// <param name="identityPoolRegion">The region of the identity pool the user belongs to</param>
/// <returns>Returns the CognitoAWSCredentials for the user to be able to access AWS resources</returns>
Creates the CognitoAWSCredentials for accessing AWS resources. Should only be called with an authenticated user.
Creates the CognitoAWSCredentials for accessing AWS resources . Should only be called with an authenticated user .
public ICognitoAWSCredentials GetCognitoAWSCredentials(string identityPoolID, RegionEndpoint identityPoolRegion, IAWSSDK sdk)
        {
            EnsureUserAuthenticated();
            string poolRegion = UserPool.PoolID.Substring(0, UserPool.PoolID.IndexOf("_"));
            string providerName = "cognito-idp." + poolRegion + ".amazonaws.com/" + UserPool.PoolID;
            ICognitoAWSCredentials credentials = sdk.CreateCognitoAWSCredentials(identityPoolID, identityPoolRegion.SystemName);
            credentials.Clear();
            credentials.AddLogin(providerName, SessionTokens.IdToken);
            return credentials;
        }
public ICognitoAWSCredentials GetCognitoAWSCredentials ( string identityPoolID , RegionEndpoint identityPoolRegion , IAWSSDK sdk ) { EnsureUserAuthenticated ( ) ; string poolRegion = UserPool . PoolID . Substring ( 0 , UserPool . PoolID . IndexOf ( " " ) ) ; string providerName = " " + poolRegion + " " + UserPool . PoolID ; ICognitoAWSCredentials credentials = sdk . CreateCognitoAWSCredentials ( identityPoolID , identityPoolRegion . SystemName ) ; credentials . Clear ( ) ; credentials . AddLogin ( providerName , SessionTokens . IdToken ) ; return credentials ; }
Creates the CognitoAWSCredentials for accessing AWS resources.
Creates the CognitoAWSCredentials for accessing AWS resources .
Returns the CognitoAWSCredentials for the user to be able to access AWS resources
Returns the CognitoAWSCredentials for the user to be able to access AWS resources
identityPoolID
string
The poolID of the identity pool the user belongs to
The poolID of the identity pool the user belongs to
identityPoolRegion
RegionEndpoint
The region of the identity pool the user belongs to
The region of the identity pool the user belongs to
sdk
IAWSSDK