in src/Amazon.Extensions.CognitoAuthentication/CognitoUserAuthentication.cs [772:801]
private InitiateAuthRequest CreateRefreshTokenAuthRequest(AuthFlowType authFlowType)
{
if (authFlowType != AuthFlowType.REFRESH_TOKEN && authFlowType != AuthFlowType.REFRESH_TOKEN_AUTH)
{
throw new ArgumentException("authFlowType must be either \"REFRESH_TOKEN\" or \"REFRESH_TOKEN_AUTH\"", "authFlowType");
}
InitiateAuthRequest initiateAuthRequest = new InitiateAuthRequest()
{
AuthFlow = authFlowType,
ClientId = ClientID,
AuthParameters = new Dictionary<string, string>()
{
{CognitoConstants.ChlgParamUsername, Username },
{CognitoConstants.ChlgParamRefreshToken, SessionTokens.RefreshToken }
}
};
if (Device != null && !string.IsNullOrEmpty(Device.DeviceKey))
{
initiateAuthRequest.AuthParameters.Add(CognitoConstants.ChlgParamDeviceKey, Device.DeviceKey);
}
if (!string.IsNullOrEmpty(SecretHash))
{
initiateAuthRequest.AuthParameters.Add(CognitoConstants.ChlgParamSecretHash, SecretHash);
}
return initiateAuthRequest;
}