1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`RespondToAuthChallenge`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder) operation.
    ///
    /// - The fluent builder is configurable:
    ///   - [`client_id(impl Into<String>)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::client_id) / [`set_client_id(Option<String>)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::set_client_id):<br>required: **true**<br><p>The app client ID.</p><br>
    ///   - [`challenge_name(ChallengeNameType)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::challenge_name) / [`set_challenge_name(Option<ChallengeNameType>)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::set_challenge_name):<br>required: **true**<br><p>The challenge name. For more information, see <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_InitiateAuth.html">InitiateAuth</a>.</p> <p><code>ADMIN_NO_SRP_AUTH</code> isn't a valid value.</p><br>
    ///   - [`session(impl Into<String>)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::session) / [`set_session(Option<String>)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::set_session):<br>required: **false**<br><p>The session that should be passed both ways in challenge-response calls to the service. If <code>InitiateAuth</code> or <code>RespondToAuthChallenge</code> API call determines that 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 <code>RespondToAuthChallenge</code> API call.</p><br>
    ///   - [`challenge_responses(impl Into<String>, impl Into<String>)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::challenge_responses) / [`set_challenge_responses(Option<HashMap::<String, String>>)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::set_challenge_responses):<br>required: **false**<br><p>The responses to the challenge that you received in the previous request. Each challenge has its own required response parameters. The following examples are partial JSON request bodies that highlight challenge-response parameters.</p><important>  <p>You must provide a SECRET_HASH parameter in all challenge responses to an app client that has a client secret.</p> </important> <dl>  <dt>   SMS_MFA  </dt>  <dd>   <p><code>"ChallengeName": "SMS_MFA", "ChallengeResponses": {"SMS_MFA_CODE": "[SMS_code]", "USERNAME": "[username]"}</code></p>  </dd>  <dt>   PASSWORD_VERIFIER  </dt>  <dd>   <p><code>"ChallengeName": "PASSWORD_VERIFIER", "ChallengeResponses": {"PASSWORD_CLAIM_SIGNATURE": "[claim_signature]", "PASSWORD_CLAIM_SECRET_BLOCK": "[secret_block]", "TIMESTAMP": [timestamp], "USERNAME": "[username]"}</code></p>   <p>Add <code>"DEVICE_KEY"</code> when you sign in with a remembered device.</p>  </dd>  <dt>   CUSTOM_CHALLENGE  </dt>  <dd>   <p><code>"ChallengeName": "CUSTOM_CHALLENGE", "ChallengeResponses": {"USERNAME": "[username]", "ANSWER": "[challenge_answer]"}</code></p>   <p>Add <code>"DEVICE_KEY"</code> when you sign in with a remembered device.</p>  </dd>  <dt>   NEW_PASSWORD_REQUIRED  </dt>  <dd>   <p><code>"ChallengeName": "NEW_PASSWORD_REQUIRED", "ChallengeResponses": {"NEW_PASSWORD": "[new_password]", "USERNAME": "[username]"}</code></p>   <p>To set any required attributes that <code>InitiateAuth</code> returned in an <code>requiredAttributes</code> parameter, add <code>"userAttributes.[attribute_name]": "[attribute_value]"</code>. This parameter can also set values for writable attributes that aren't required by your user pool.</p><note>    <p>In a <code>NEW_PASSWORD_REQUIRED</code> challenge response, you can't modify a required attribute that already has a value. In <code>RespondToAuthChallenge</code>, set a value for any keys that Amazon Cognito returned in the <code>requiredAttributes</code> parameter, then use the <code>UpdateUserAttributes</code> API operation to modify the value of any additional attributes.</p>   </note>  </dd>  <dt>   SOFTWARE_TOKEN_MFA  </dt>  <dd>   <p><code>"ChallengeName": "SOFTWARE_TOKEN_MFA", "ChallengeResponses": {"USERNAME": "[username]", "SOFTWARE_TOKEN_MFA_CODE": [authenticator_code]}</code></p>  </dd>  <dt>   DEVICE_SRP_AUTH  </dt>  <dd>   <p><code>"ChallengeName": "DEVICE_SRP_AUTH", "ChallengeResponses": {"USERNAME": "[username]", "DEVICE_KEY": "[device_key]", "SRP_A": "[srp_a]"}</code></p>  </dd>  <dt>   DEVICE_PASSWORD_VERIFIER  </dt>  <dd>   <p><code>"ChallengeName": "DEVICE_PASSWORD_VERIFIER", "ChallengeResponses": {"DEVICE_KEY": "[device_key]", "PASSWORD_CLAIM_SIGNATURE": "[claim_signature]", "PASSWORD_CLAIM_SECRET_BLOCK": "[secret_block]", "TIMESTAMP": [timestamp], "USERNAME": "[username]"}</code></p>  </dd>  <dt>   MFA_SETUP  </dt>  <dd>   <p><code>"ChallengeName": "MFA_SETUP", "ChallengeResponses": {"USERNAME": "[username]"}, "SESSION": "[Session ID from VerifySoftwareToken]"</code></p>  </dd>  <dt>   SELECT_MFA_TYPE  </dt>  <dd>   <p><code>"ChallengeName": "SELECT_MFA_TYPE", "ChallengeResponses": {"USERNAME": "[username]", "ANSWER": "[SMS_MFA or SOFTWARE_TOKEN_MFA]"}</code></p>  </dd> </dl> <p>For more information about <code>SECRET_HASH</code>, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/signing-up-users-in-your-app.html#cognito-user-pools-computing-secret-hash">Computing secret hash values</a>. For information about <code>DEVICE_KEY</code>, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-device-tracking.html">Working with user devices in your user pool</a>.</p><br>
    ///   - [`analytics_metadata(AnalyticsMetadataType)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::analytics_metadata) / [`set_analytics_metadata(Option<AnalyticsMetadataType>)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::set_analytics_metadata):<br>required: **false**<br><p>The Amazon Pinpoint analytics metadata that contributes to your metrics for <code>RespondToAuthChallenge</code> calls.</p><br>
    ///   - [`user_context_data(UserContextDataType)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::user_context_data) / [`set_user_context_data(Option<UserContextDataType>)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::set_user_context_data):<br>required: **false**<br><p>Contextual data about your user session, such as the device fingerprint, IP address, or location. Amazon Cognito advanced security evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.</p><br>
    ///   - [`client_metadata(impl Into<String>, impl Into<String>)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::client_metadata) / [`set_client_metadata(Option<HashMap::<String, String>>)`](crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::set_client_metadata):<br>required: **false**<br><p>A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.</p> <p>You create custom workflows by assigning Lambda functions to user pool triggers. When you use the RespondToAuthChallenge API action, Amazon Cognito invokes any functions that are assigned to the following triggers: <i>post authentication</i>, <i>pre token generation</i>, <i>define auth challenge</i>, <i>create auth challenge</i>, and <i>verify auth challenge</i>. When Amazon Cognito invokes any of these functions, it passes a JSON payload, which the function receives as input. This payload contains a <code>clientMetadata</code> attribute, which provides the data that you assigned to the ClientMetadata parameter in your RespondToAuthChallenge request. In your function code in Lambda, you can process the <code>clientMetadata</code> value to enhance your workflow for your specific needs.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html"> Customizing user pool Workflows with Lambda Triggers</a> in the <i>Amazon Cognito Developer Guide</i>.</p><note>  <p>When you use the ClientMetadata parameter, remember that Amazon Cognito won't do the following:</p>  <ul>   <li>    <p>Store the ClientMetadata value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the ClientMetadata parameter serves no purpose.</p></li>   <li>    <p>Validate the ClientMetadata value.</p></li>   <li>    <p>Encrypt the ClientMetadata value. Don't use Amazon Cognito to provide sensitive information.</p></li>  </ul> </note><br>
    /// - On success, responds with [`RespondToAuthChallengeOutput`](crate::operation::respond_to_auth_challenge::RespondToAuthChallengeOutput) with field(s):
    ///   - [`challenge_name(Option<ChallengeNameType>)`](crate::operation::respond_to_auth_challenge::RespondToAuthChallengeOutput::challenge_name): <p>The challenge name. For more information, see <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_InitiateAuth.html">InitiateAuth</a>.</p>
    ///   - [`session(Option<String>)`](crate::operation::respond_to_auth_challenge::RespondToAuthChallengeOutput::session): <p>The session that should be passed 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 <code>RespondToAuthChallenge</code> API call.</p>
    ///   - [`challenge_parameters(Option<HashMap::<String, String>>)`](crate::operation::respond_to_auth_challenge::RespondToAuthChallengeOutput::challenge_parameters): <p>The challenge parameters. For more information, see <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_InitiateAuth.html">InitiateAuth</a>.</p>
    ///   - [`authentication_result(Option<AuthenticationResultType>)`](crate::operation::respond_to_auth_challenge::RespondToAuthChallengeOutput::authentication_result): <p>The result returned by the server in response to the request to respond to the authentication challenge.</p>
    /// - On failure, responds with [`SdkError<RespondToAuthChallengeError>`](crate::operation::respond_to_auth_challenge::RespondToAuthChallengeError)
    pub fn respond_to_auth_challenge(&self) -> crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder {
        crate::operation::respond_to_auth_challenge::builders::RespondToAuthChallengeFluentBuilder::new(self.handle.clone())
    }
}