Struct aws_sdk_cognitoidentityprovider::operation::associate_software_token::builders::AssociateSoftwareTokenFluentBuilder
source · pub struct AssociateSoftwareTokenFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to AssociateSoftwareToken
.
Begins setup of time-based one-time password (TOTP) multi-factor authentication (MFA) for a user, with a unique private key that Amazon Cognito generates and returns in the API response. You can authorize an AssociateSoftwareToken
request with either the user's access token, or a session string from a challenge response that you received from Amazon Cognito.
Amazon Cognito disassociates an existing software token when you verify the new token in a VerifySoftwareToken API request. If you don't verify the software token and your user pool doesn't require MFA, the user can then authenticate with user name and password credentials alone. If your user pool requires TOTP MFA, Amazon Cognito generates an MFA_SETUP
or SOFTWARE_TOKEN_SETUP
challenge each time your user signs. Complete setup with AssociateSoftwareToken
and VerifySoftwareToken
.
After you set up software token MFA for your user, Amazon Cognito generates a SOFTWARE_TOKEN_MFA
challenge when they authenticate. Respond to this challenge with your user's TOTP.
Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.
Implementations§
source§impl AssociateSoftwareTokenFluentBuilder
impl AssociateSoftwareTokenFluentBuilder
sourcepub fn as_input(&self) -> &AssociateSoftwareTokenInputBuilder
pub fn as_input(&self) -> &AssociateSoftwareTokenInputBuilder
Access the AssociateSoftwareToken as a reference.
sourcepub async fn send(
self,
) -> Result<AssociateSoftwareTokenOutput, SdkError<AssociateSoftwareTokenError, HttpResponse>>
pub async fn send( self, ) -> Result<AssociateSoftwareTokenOutput, SdkError<AssociateSoftwareTokenError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn customize(
self,
) -> CustomizableOperation<AssociateSoftwareTokenOutput, AssociateSoftwareTokenError, Self>
pub fn customize( self, ) -> CustomizableOperation<AssociateSoftwareTokenOutput, AssociateSoftwareTokenError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
sourcepub fn access_token(self, input: impl Into<String>) -> Self
pub fn access_token(self, input: impl Into<String>) -> Self
A valid access token that Amazon Cognito issued to the user whose software token you want to generate.
sourcepub fn set_access_token(self, input: Option<String>) -> Self
pub fn set_access_token(self, input: Option<String>) -> Self
A valid access token that Amazon Cognito issued to the user whose software token you want to generate.
sourcepub fn get_access_token(&self) -> &Option<String>
pub fn get_access_token(&self) -> &Option<String>
A valid access token that Amazon Cognito issued to the user whose software token you want to generate.
sourcepub fn session(self, input: impl Into<String>) -> Self
pub fn session(self, input: impl Into<String>) -> Self
The session that should be passed both ways in challenge-response calls to the service. This allows authentication of the user as part of the MFA setup process.
sourcepub fn set_session(self, input: Option<String>) -> Self
pub fn set_session(self, input: Option<String>) -> Self
The session that should be passed both ways in challenge-response calls to the service. This allows authentication of the user as part of the MFA setup process.
sourcepub fn get_session(&self) -> &Option<String>
pub fn get_session(&self) -> &Option<String>
The session that should be passed both ways in challenge-response calls to the service. This allows authentication of the user as part of the MFA setup process.
Trait Implementations§
source§impl Clone for AssociateSoftwareTokenFluentBuilder
impl Clone for AssociateSoftwareTokenFluentBuilder
source§fn clone(&self) -> AssociateSoftwareTokenFluentBuilder
fn clone(&self) -> AssociateSoftwareTokenFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for AssociateSoftwareTokenFluentBuilder
impl !RefUnwindSafe for AssociateSoftwareTokenFluentBuilder
impl Send for AssociateSoftwareTokenFluentBuilder
impl Sync for AssociateSoftwareTokenFluentBuilder
impl Unpin for AssociateSoftwareTokenFluentBuilder
impl !UnwindSafe for AssociateSoftwareTokenFluentBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more