Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- data AssociateSoftwareToken = AssociateSoftwareToken' {}
- newAssociateSoftwareToken :: AssociateSoftwareToken
- associateSoftwareToken_accessToken :: Lens' AssociateSoftwareToken (Maybe Text)
- associateSoftwareToken_session :: Lens' AssociateSoftwareToken (Maybe Text)
- data AssociateSoftwareTokenResponse = AssociateSoftwareTokenResponse' {
- secretCode :: Maybe (Sensitive Text)
- session :: Maybe Text
- httpStatus :: Int
- newAssociateSoftwareTokenResponse :: Int -> AssociateSoftwareTokenResponse
- associateSoftwareTokenResponse_secretCode :: Lens' AssociateSoftwareTokenResponse (Maybe Text)
- associateSoftwareTokenResponse_session :: Lens' AssociateSoftwareTokenResponse (Maybe Text)
- associateSoftwareTokenResponse_httpStatus :: Lens' AssociateSoftwareTokenResponse Int
Creating a Request
data AssociateSoftwareToken Source #
See: newAssociateSoftwareToken
smart constructor.
AssociateSoftwareToken' | |
|
Instances
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.
AssociateSoftwareTokenResponse' | |
|
Instances
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.
associateSoftwareTokenResponse_httpStatus :: Lens' AssociateSoftwareTokenResponse Int Source #
The response's http status code.