amazonka-cognito-idp-2.0: Amazon Cognito Identity Provider SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

Description

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.

Synopsis

Creating a Request

data AssociateSoftwareToken Source #

See: newAssociateSoftwareToken smart constructor.

Constructors

AssociateSoftwareToken' 

Fields

  • accessToken :: Maybe (Sensitive Text)

    A valid access token that Amazon Cognito issued to the user whose software token you want to generate.

  • session :: Maybe Text

    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.

Instances

Instances details
ToJSON AssociateSoftwareToken Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

ToHeaders AssociateSoftwareToken Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

ToPath AssociateSoftwareToken Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

ToQuery AssociateSoftwareToken Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

AWSRequest AssociateSoftwareToken Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

Associated Types

type AWSResponse AssociateSoftwareToken #

Generic AssociateSoftwareToken Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

Associated Types

type Rep AssociateSoftwareToken :: Type -> Type #

Show AssociateSoftwareToken Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

NFData AssociateSoftwareToken Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

Methods

rnf :: AssociateSoftwareToken -> () #

Eq AssociateSoftwareToken Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

Hashable AssociateSoftwareToken Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

type AWSResponse AssociateSoftwareToken Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

type Rep AssociateSoftwareToken Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

type Rep AssociateSoftwareToken = D1 ('MetaData "AssociateSoftwareToken" "Amazonka.CognitoIdentityProvider.AssociateSoftwareToken" "amazonka-cognito-idp-2.0-D1ERgMvEVPG9z8cOLXdU2" 'False) (C1 ('MetaCons "AssociateSoftwareToken'" 'PrefixI 'True) (S1 ('MetaSel ('Just "accessToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Sensitive Text))) :*: S1 ('MetaSel ('Just "session") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))))

newAssociateSoftwareToken :: AssociateSoftwareToken Source #

Create a value of AssociateSoftwareToken with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

AssociateSoftwareToken, associateSoftwareToken_accessToken - A valid access token that Amazon Cognito issued to the user whose software token you want to generate.

AssociateSoftwareToken, associateSoftwareToken_session - 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.

Request Lenses

associateSoftwareToken_accessToken :: Lens' AssociateSoftwareToken (Maybe Text) Source #

A valid access token that Amazon Cognito issued to the user whose software token you want to generate.

associateSoftwareToken_session :: Lens' AssociateSoftwareToken (Maybe Text) Source #

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.

Destructuring the Response

data AssociateSoftwareTokenResponse Source #

See: newAssociateSoftwareTokenResponse smart constructor.

Constructors

AssociateSoftwareTokenResponse' 

Fields

  • secretCode :: Maybe (Sensitive Text)

    A unique generated shared secret code that is used in the TOTP algorithm to generate a one-time code.

  • session :: Maybe Text

    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.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic AssociateSoftwareTokenResponse Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

Associated Types

type Rep AssociateSoftwareTokenResponse :: Type -> Type #

Show AssociateSoftwareTokenResponse Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

NFData AssociateSoftwareTokenResponse Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

Eq AssociateSoftwareTokenResponse Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

type Rep AssociateSoftwareTokenResponse Source # 
Instance details

Defined in Amazonka.CognitoIdentityProvider.AssociateSoftwareToken

type Rep AssociateSoftwareTokenResponse = D1 ('MetaData "AssociateSoftwareTokenResponse" "Amazonka.CognitoIdentityProvider.AssociateSoftwareToken" "amazonka-cognito-idp-2.0-D1ERgMvEVPG9z8cOLXdU2" 'False) (C1 ('MetaCons "AssociateSoftwareTokenResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "secretCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Sensitive Text))) :*: (S1 ('MetaSel ('Just "session") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newAssociateSoftwareTokenResponse Source #

Create a value of AssociateSoftwareTokenResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:secretCode:AssociateSoftwareTokenResponse', associateSoftwareTokenResponse_secretCode - A unique generated shared secret code that is used in the TOTP algorithm to generate a one-time code.

AssociateSoftwareToken, associateSoftwareTokenResponse_session - 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.

$sel:httpStatus:AssociateSoftwareTokenResponse', associateSoftwareTokenResponse_httpStatus - The response's http status code.

Response Lenses

associateSoftwareTokenResponse_secretCode :: Lens' AssociateSoftwareTokenResponse (Maybe Text) Source #

A unique generated shared secret code that is used in the TOTP algorithm to generate a one-time code.

associateSoftwareTokenResponse_session :: Lens' AssociateSoftwareTokenResponse (Maybe Text) Source #

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.