public class AssociateSoftwareTokenRequest
extends com.amazonaws.AmazonWebServiceRequest
implements java.io.Serializable
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 native and OIDC APIs.
| Constructor and Description |
|---|
AssociateSoftwareTokenRequest() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAccessToken()
A valid access token that Amazon Cognito issued to the user whose
software token you want to generate.
|
java.lang.String |
getSession()
The session that should be passed both ways in challenge-response calls
to the service.
|
int |
hashCode() |
void |
setAccessToken(java.lang.String accessToken)
A valid access token that Amazon Cognito issued to the user whose
software token you want to generate.
|
void |
setSession(java.lang.String session)
The session that should be passed both ways in challenge-response calls
to the service.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
AssociateSoftwareTokenRequest |
withAccessToken(java.lang.String accessToken)
A valid access token that Amazon Cognito issued to the user whose
software token you want to generate.
|
AssociateSoftwareTokenRequest |
withSession(java.lang.String session)
The session that should be passed both ways in challenge-response calls
to the service.
|
clone, copyBaseTo, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollectorpublic java.lang.String getAccessToken()
A valid access token that Amazon Cognito issued to the user whose software token you want to generate.
Constraints:
Pattern: [A-Za-z0-9-_=.]+
A valid access token that Amazon Cognito issued to the user whose software token you want to generate.
public void setAccessToken(java.lang.String accessToken)
A valid access token that Amazon Cognito issued to the user whose software token you want to generate.
Constraints:
Pattern: [A-Za-z0-9-_=.]+
accessToken - A valid access token that Amazon Cognito issued to the user whose software token you want to generate.
public AssociateSoftwareTokenRequest withAccessToken(java.lang.String accessToken)
A valid access token that Amazon Cognito issued to the user whose software token you want to generate.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Pattern: [A-Za-z0-9-_=.]+
accessToken - A valid access token that Amazon Cognito issued to the user whose software token you want to generate.
public java.lang.String getSession()
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.
Constraints:
Length: 20 - 2048
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.
public void setSession(java.lang.String 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.
Constraints:
Length: 20 - 2048
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.
public AssociateSoftwareTokenRequest withSession(java.lang.String 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.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 20 - 2048
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.
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object