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 the authentication response. This result is only returned if the caller
doesn't need to pass another challenge. If the caller does need to pass another challenge
before it gets tokens, |
|
ChallengeName | Amazon.CognitoIdentityProvider.ChallengeNameType |
Gets and sets the property ChallengeName.
The name of the challenge that you're responding to with this call. This name is returned
in the Valid values 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 challenge parameters. These are returned in 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 that should pass both ways in challenge-response calls to the service.
If the caller must pass another challenge, they return a session with other challenge
parameters. This session should be passed as it is to the next |
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 Core App:
Supported in: 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5, 4.0, 3.5