aws_sdk_cognitoidentityprovider/client/
get_tokens_from_refresh_token.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`GetTokensFromRefreshToken`](crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`refresh_token(impl Into<String>)`](crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder::refresh_token) / [`set_refresh_token(Option<String>)`](crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder::set_refresh_token):<br>required: **true**<br><p>A valid refresh token that can authorize the request for new tokens. When refresh token rotation is active in the requested app client, this token is invalidated after the request is complete and after an optional grace period.</p><br>
7    ///   - [`client_id(impl Into<String>)`](crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder::client_id) / [`set_client_id(Option<String>)`](crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder::set_client_id):<br>required: **true**<br><p>The app client that issued the refresh token to the user who wants to request new tokens.</p><br>
8    ///   - [`client_secret(impl Into<String>)`](crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder::client_secret) / [`set_client_secret(Option<String>)`](crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder::set_client_secret):<br>required: **false**<br><p>The client secret of the requested app client, if the client has a secret.</p><br>
9    ///   - [`device_key(impl Into<String>)`](crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder::device_key) / [`set_device_key(Option<String>)`](crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder::set_device_key):<br>required: **false**<br><p>When you enable device remembering, Amazon Cognito issues a device key that you can use for device authentication that bypasses multi-factor authentication (MFA). To implement <code>GetTokensFromRefreshToken</code> in a user pool with device remembering, you must capture the device key from the initial authentication request. If your application doesn't provide the key of a registered device, Amazon Cognito issues a new one. You must provide the confirmed device key in this request if device remembering is enabled in your user pool.</p> <p>For more information about device remembering, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-device-tracking.html">Working with devices</a>.</p><br>
10    ///   - [`client_metadata(impl Into<String>, impl Into<String>)`](crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder::client_metadata) / [`set_client_metadata(Option<HashMap::<String, String>>)`](crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder::set_client_metadata):<br>required: **false**<br><p>A map of custom key-value pairs that you can provide as input for certain custom workflows that this action triggers.</p> <p>You create custom workflows by assigning Lambda functions to user pool triggers. When you use the <code>GetTokensFromRefreshToken</code> API action, Amazon Cognito invokes the Lambda function the pre token generation trigger.</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"> Using Lambda triggers</a> in the <i>Amazon Cognito Developer Guide</i>.</p><note>  <p>When you use the <code>ClientMetadata</code> parameter, note that Amazon Cognito won't do the following:</p>  <ul>   <li>    <p>Store the <code>ClientMetadata</code> 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 <code>ClientMetadata</code> parameter serves no purpose.</p></li>   <li>    <p>Validate the <code>ClientMetadata</code> value.</p></li>   <li>    <p>Encrypt the <code>ClientMetadata</code> value. Don't send sensitive information in this parameter.</p></li>  </ul> </note><br>
11    /// - On success, responds with [`GetTokensFromRefreshTokenOutput`](crate::operation::get_tokens_from_refresh_token::GetTokensFromRefreshTokenOutput) with field(s):
12    ///   - [`authentication_result(Option<AuthenticationResultType>)`](crate::operation::get_tokens_from_refresh_token::GetTokensFromRefreshTokenOutput::authentication_result): <p>The object that your application receives after authentication. Contains tokens and information for device authentication.</p>
13    /// - On failure, responds with [`SdkError<GetTokensFromRefreshTokenError>`](crate::operation::get_tokens_from_refresh_token::GetTokensFromRefreshTokenError)
14    pub fn get_tokens_from_refresh_token(&self) -> crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder {
15        crate::operation::get_tokens_from_refresh_token::builders::GetTokensFromRefreshTokenFluentBuilder::new(self.handle.clone())
16    }
17}