src/AWSSDK.Extensions.CognitoAuthentication/CognitoUserAuthentication.cs
/// <summary>
/// Initiates the asynchronous refresh token authentication flow
/// </summary>
/// <param name="refreshTokenRequest">InitiateRefreshTokenAuthRequest object containing the necessary 
/// parameters to initiate the refresh token authentication flow</param>
/// <returns>Returns the AuthFlowResponse object that can be used to respond to the next challenge, 
/// if one exists</returns>
Initiates the asynchronous refresh token authentication flow
Initiates the asynchronous refresh token authentication flow
public void StartWithRefreshTokenAuthAsync(InitiateRefreshTokenAuthRequest refreshTokenRequest, AsyncCallback<AuthFlowResponse> callback = null)
        {
            InitiateAuthRequest initiateAuthRequest = CreateRefreshTokenAuthRequest(refreshTokenRequest.AuthFlowType);
            Provider.InitiateAuthAsync(initiateAuthRequest, r =>
            {
                if (r.Exception != null)
                {
                    callback?.Invoke(new AsyncResult<AuthFlowResponse>(null, r.Exception));
                    return;
                }
                InitiateAuthResponse initiateResponse = r.Response;
                UpdateSessionIfAuthenticationComplete(initiateResponse.ChallengeName, initiateResponse.AuthenticationResult);
                callback?.Invoke(new AsyncResult<AuthFlowResponse>(new AuthFlowResponse()
                {
                    SessionID = initiateResponse.Session,
                    ChallengeName = initiateResponse.ChallengeName,
                    AuthenticationResult = initiateResponse.AuthenticationResult,
                    ChallengeParameters = initiateResponse.ChallengeParameters,
                    ClientMetadata = new Dictionary<string, string>(initiateResponse.ResponseMetadata.Metadata)
                }, null));
            });
        }
public void StartWithRefreshTokenAuthAsync ( InitiateRefreshTokenAuthRequest refreshTokenRequest , AsyncCallback < AuthFlowResponse > callback = null ) { InitiateAuthRequest initiateAuthRequest = CreateRefreshTokenAuthRequest ( refreshTokenRequest . AuthFlowType ) ; Provider . InitiateAuthAsync ( initiateAuthRequest , r => { if ( r . Exception != null ) { callback ? . Invoke ( new AsyncResult < AuthFlowResponse > ( null , r . Exception ) ) ; return ; } InitiateAuthResponse initiateResponse = r . Response ; UpdateSessionIfAuthenticationComplete ( initiateResponse . ChallengeName , initiateResponse . AuthenticationResult ) ; callback ? . Invoke ( new AsyncResult < AuthFlowResponse > ( new AuthFlowResponse ( ) { SessionID = initiateResponse . Session , ChallengeName = initiateResponse . ChallengeName , AuthenticationResult = initiateResponse . AuthenticationResult , ChallengeParameters = initiateResponse . ChallengeParameters , ClientMetadata = new Dictionary < string , string > ( initiateResponse . ResponseMetadata . Metadata ) } , null ) ) ; } ) ; }
Initiates the asynchronous refresh token authentication flow
Initiates the asynchronous refresh token authentication flow
Returns the AuthFlowResponse object that can be used to respond to the next challenge,
if one exists
Returns the AuthFlowResponse object that can be used to respond to the next challenge if one exists
refreshTokenRequest
InitiateRefreshTokenAuthRequest
InitiateRefreshTokenAuthRequest object containing the necessary
parameters to initiate the refresh token authentication flow
InitiateRefreshTokenAuthRequest object containing the necessary parameters to initiate the refresh token authentication flow
callback
AsyncCallback<AuthFlowResponse>