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.
Initiates the authentication response.
Namespace: Amazon.CognitoIdentityProvider.Model
Assembly: AWSSDK.CognitoIdentityProvider.dll
Version: 3.x.y.z
public class InitiateAuthResponse : AmazonWebServiceResponse
The InitiateAuthResponse type exposes the following members
Name | Description | |
---|---|---|
![]() |
InitiateAuthResponse() |
Name | Type | Description | |
---|---|---|---|
![]() |
AuthenticationResult | Amazon.CognitoIdentityProvider.Model.AuthenticationResultType |
Gets and sets the property AuthenticationResult.
The result of a successful and complete authentication request. This result is only
returned if the user doesn't need to pass another challenge. If they must pass another
challenge before they get tokens, Amazon Cognito returns a challenge in |
![]() |
AvailableChallenges | System.Collections.Generic.List<System.String> |
Gets and sets the property AvailableChallenges. This response parameter lists the available authentication challenges that users can select from in choice-based authentication. For example, they might be able to choose between passkey authentication, a one-time password from an SMS message, and a traditional password. |
![]() |
ChallengeName | Amazon.CognitoIdentityProvider.ChallengeNameType |
Gets and sets the property ChallengeName. The name of an additional authentication challenge that you must respond to. Possible challenges include the following:
All of the following challenges require
|
![]() |
ChallengeParameters | System.Collections.Generic.Dictionary<System.String, System.String> |
Gets and sets the property ChallengeParameters.
The required parameters of the
All challenges require |
![]() |
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
ResponseMetadata | Amazon.Runtime.ResponseMetadata | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
Session | System.String |
Gets and sets the property Session. The session identifier that links a challenge response to the initial authentication request. If the user must pass another challenge, Amazon Cognito returns a session ID and challenge parameters. |
The following example signs in the user mytestuser with analytics data, client metadata, and user context data for advanced security.
var client = new AmazonCognitoIdentityProviderClient(); var response = client.InitiateAuth(new InitiateAuthRequest { AnalyticsMetadata = new AnalyticsMetadataType { AnalyticsEndpointId = "d70b2ba36a8c4dc5a04a0451a31a1e12" }, AuthFlow = "USER_PASSWORD_AUTH", AuthParameters = new Dictionary<string, string> { { "PASSWORD", "This-is-my-test-99!" }, { "SECRET_HASH", "oT5ZkS8ctnrhYeeGsGTvOzPhoc/Jd1cO5fueBWFVmp8=" }, { "USERNAME", "mytestuser" } }, ClientId = "1example23456789", ClientMetadata = new Dictionary<string, string> { { "MyTestKey", "MyTestValue" } }, UserContextData = new UserContextDataType { EncodedData = "AmazonCognitoAdvancedSecurityData_object", IpAddress = "192.0.2.1" } }); string challengeName = response.ChallengeName; Dictionary<string, string> challengeParameters = response.ChallengeParameters; string session = response.Session;
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5