You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the next step is `confirmSignInWithSmsMfaCode`, Amplify Auth has sent the user a random code over SMS and is waiting for the user to verify that code. To handle this step, your app's UI must prompt the user to enter the code. After the user enters the code, pass the value to the `confirmSignIn` API.
If the next step is `confirmSignInWithTOTPCode`, you should prompt the user to enter the TOTP code from their associated authenticator app during set up. The code is a six-digit number that changes every 30 seconds. The user must enter the code before the 30-second window expires.
If the next step is `confirmSignInWithEmailMfaCode`, Amplify Auth has sent the user a random code to their email address and is waiting for the user to verify that code. To handle this step, your app's UI must prompt the user to enter the code. After the user enters the code, pass the value to the `confirmSignIn` API.
If the next step is `continueSignInWithMFASelection`, the user must select the MFA method to use. Amplify Auth currently supports SMS, TOTP, and email as MFA methods. After the user selects an MFA method, your implementation must pass the selected MFA method to Amplify Auth using `confirmSignIn` API.
If the next step is `continueSignInWithEmailMfaSetup`, then the user must provide an email address to complete the sign in process. Once this value has been collected from the user, call the `confirmSignIn` API to continue.
If the next step is `continueSignInWithTOTPSetup`, then the user must provide a TOTP code to complete the sign in process. The step returns an associated value of type `TOTPSetupDetails` which would be used for generating TOTP. `TOTPSetupDetails` provides a helper method called `getSetupURI` that can be used to generate a URI, which can be used by native password managers for TOTP association. For example. if the URI is used on Apple platforms, it will trigger the platform's native password manager to associate TOTP with the account. For more advanced use cases, `TOTPSetupDetails` also contains the `sharedSecret` that will be used to either generate a QR code or can be manually entered into an authenticator app.
If the next step is `continueSignInWithMfaSetupSelection`, then the user must indicate which of the available MFA methods they would like to setup. After the user selects an MFA method to setup, your implementation must pass the selected MFA method to the `confirmSignIn` API.
308
308
309
309
The MFA types which are currently supported by Amplify Auth are:
If the next step is `confirmSignInWithCustomChallenge`, Amplify Auth is awaiting completion of a custom authentication challenge. The challenge is based on the AWS Lambda trigger you configured as part of a [custom sign in flow](/[platform]/build-a-backend/auth/customize-auth-lifecycle/custom-auth-flows/#sign-in-a-user).
346
346
@@ -382,7 +382,7 @@ If `failAuthentication=true` is returned by the Lambda, Cognito will invalidate
382
382
383
383
</Callout>
384
384
385
-
###Confirm signin with new password
385
+
## Confirm signin with new password
386
386
If the next step is `confirmSignInWithNewPassword`, Amplify Auth requires the user choose a new password they proceeding with the sign in.
387
387
388
388
Prompt the user for a new password and pass it to the `confirmSignIn` API.
If the next step is `CONFIRM_SIGN_IN_WITH_SMS_MFA_CODE`, Amplify Auth has sent the user a random code over SMS, and is waiting to find out if the user successfully received it. To handle this step, your app's UI must prompt the user to enter the code. After the user enters the code, your implementation must pass the value to Amplify Auth `confirmSignIn` API.
If the next step is `CONFIRM_SIGN_IN_WITH_TOTP_CODE`, you should prompt the user to enter the TOTP code from their associated authenticator app during set up. The code is a six-digit number that changes every 30 seconds. The user must enter the code before the 30-second window expires.
1035
1035
1036
1036
After the user enters the code, your implementation must pass the value to Amplify Auth `confirmSignIn` API.
1037
1037
1038
-
###Confirm signin with Email MFA
1038
+
## Confirm signin with Email MFA
1039
1039
1040
1040
If the next step is `CONFIRM_SIGN_IN_WITH_EMAIL_MFA_CODE`, Amplify Auth has sent the user a random code to their email address and is waiting to find out if the user successfully received it. To handle this step, your app's UI must prompt the user to enter the code. After the user enters the code, your implementation must pass the value to Amplify Auth `confirmSignIn` API.
1041
1041
1042
1042
Note: the signIn result also includes an `AuthCodeDeliveryDetails` member. It includes additional information about the code delivery such as the partial email address of the recipient.
1043
1043
1044
-
###Continue signin with MFA Selection
1044
+
## Continue signin with MFA Selection
1045
1045
1046
1046
If the next step is `CONTINUE_SIGN_IN_WITH_MFA_SELECTION`, the user must select the MFA method to use. Amplify Auth currently supports SMS, TOTP, and email as MFA methods. After the user selects an MFA method, your implementation must pass the selected MFA method to Amplify Auth using `confirmSignIn` API.
1047
1047
1048
-
###Continue signin with Email Setup
1048
+
## Continue signin with Email Setup
1049
1049
1050
1050
If the next step is `CONTINUE_SIGN_IN_WITH_EMAIL_MFA_SETUP`, then the user must provide an email address to complete the sign in process. Once this value has been collected from the user, call the `confirmSignIn` API to continue.
1051
1051
1052
-
###Continue signin with TOTP Setup
1052
+
## Continue signin with TOTP Setup
1053
1053
1054
1054
If the next step is `CONTINUE_SIGN_IN_WITH_TOTP_SETUP`, then the user must provide a TOTP code to complete the sign in process. The step returns an associated value of type `TOTPSetupDetails` which would be used for generating TOTP. `TOTPSetupDetails` provides a helper method called `getSetupURI` that can be used to generate a URI, which can be used by native password managers for TOTP association. For example. if the URI is used on Apple platforms, it will trigger the platform's native password manager to associate TOTP with the account. For more advanced use cases, `TOTPSetupDetails` also contains the `sharedSecret` that will be used to either generate a QR code or can be manually entered into an authenticator app.
1055
1055
1056
1056
Once the authenticator app is set up, the user can generate a TOTP code and provide it to the library to complete the sign in process.
1057
1057
1058
-
###Continue signin with MFA Setup Selection
1058
+
## Continue signin with MFA Setup Selection
1059
1059
1060
1060
If the next step is `CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION`, the user must select the MFA method to setup. Amplify Auth currently supports SMS, TOTP, and email as MFA methods. After the user selects an MFA method, your implementation must pass the selected MFA method to Amplify Auth using `confirmSignIn` API.
1061
1061
1062
1062
1063
-
###Confirm signin with custom challenge
1063
+
## Confirm signin with custom challenge
1064
1064
1065
1065
If the next step is `CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE`, Amplify Auth is awaiting completion of a custom authentication challenge. The challenge is based on the Lambda trigger you setup when you configured a [custom sign in flow](/[platform]/build-a-backend/auth/customize-auth-lifecycle/custom-auth-flows/#sign-in-a-user). To complete this step, you should prompt the user for the custom challenge answer, and pass the answer to the `confirmSignIn` API.
1066
1066
@@ -1174,7 +1174,7 @@ NotAuthorizedException{message=Failed since user is not authorized., cause=NotAu
1174
1174
1175
1175
</Callout>
1176
1176
1177
-
###Confirm signin with new password
1177
+
## Confirm signin with new password
1178
1178
If you receive a `UserNotConfirmedException` while signing in, Amplify Auth requires a new password for the user before they can proceed. Prompt the user for a new password and pass it to the `confirmSignIn` API.
If you receive `PasswordResetRequiredException`, authentication flow could not proceed without resetting the password. The next step is to invoke `resetPassword` api and follow the reset password flow.
If you receive `CONFIRM_SIGN_UP` as a next step, sign up could not proceed without confirming user information such as email or phone number. The next step is to invoke the `confirmSignUp` API and follow the confirm signup flow.
This call fetches the current logged in user and should be used after a user has been successfully signed in.
1403
1403
If the user is signed in, it will return the current userId and username.
@@ -1453,7 +1453,7 @@ try {
1453
1453
1454
1454
</BlockSwitcher>
1455
1455
1456
-
###Done
1456
+
## Done
1457
1457
1458
1458
SignIn flow is complete when you get `done`.This means the user is successfully authenticated. As a convenience, the SignInResult also provides the `isSignedIn` property, which will be trueif the next step is `done`.
The `nextStep` property is of enum type `AuthSignInStep`. Depending on its value, your code should take one of the following actions:
1573
1573
1574
-
### Confirm signin with SMS MFA
1574
+
## Confirm signin with SMS MFA
1575
1575
If the next step is `confirmSignInWithSMSMFACode`, Amplify Auth has sent the user a random code over SMS, and is waiting to find out if the user successfully received it. To handle this step, your app's UI must prompt the user to enter the code. After the user enters the code, your implementation must pass the value to AmplifyAuth `confirmSignIn` API.
1576
1576
1577
1577
Note: the signin result also includes an `AuthCodeDeliveryDetails` member. It includes additional information about the code delivery such as the partial phone number of the SMS recipient.
If the next step is `confirmSignInWithTOTPCode`, you should prompt the user to enter the TOTP code from their associated authenticator app during set up. The code is a six-digit number that changes every 30 seconds. The user must enter the code before the 30-second window expires.
If the next step is `confirmSignInWithEmailMFACode`, AmplifyAuth has sent a random code to the user's email address, and is waiting to find out if the user successfully received it. To handle this step, your app's UI must prompt the user to enter the code. After the user enters the code, your implementation must pass the value to AmplifyAuth `confirmSignIn` API.
1697
1697
1698
1698
Note: the signin result also includes an `AuthCodeDeliveryDetails` member. It includes additional information about the code delivery such as the partial email address of the recipient.
If the next step is `continueSignInWithMFASelection`, the user must select the MFA method to use. AmplifyAuth currently supports SMS, TOTP, and email as MFA methods. After the user selects an MFA method, your implementation must pass the selected MFA method to AmplifyAuth using `confirmSignIn` API.
If the next step is `continueSignInWithEmailMFASetup`, then the user must provide an email address to complete the sign in process. Oncethis value has been collected from the user, call the `confirmSignIn` API to continue.
1809
1809
1810
1810
```swift
@@ -1816,7 +1816,7 @@ case .continueSignInWithEmailMFASetup:
1816
1816
// Then invoke `confirmSignIn` api with the email address
1817
1817
```
1818
1818
1819
-
###Continue signin with TOTPSetup
1819
+
## Continue signin with TOTPSetup
1820
1820
1821
1821
If the next step is `continueSignInWithTOTPSetup`, then the user must provide a TOTP code to complete the sign in process. The step returns an associated value of type `TOTPSetupDetails` which would be used for generating TOTP. `TOTPSetupDetails` provides a helper method called `getSetupURI` that can be used to generate a URI, which can be used by native password managers forTOTP association. For example. if the URI is used on Apple platforms, it will trigger the platform's native password manager to associate TOTP with the account. For more advanced use cases, `TOTPSetupDetails` also contains the `sharedSecret` that will be used to either generate a QR code or can be manually entered into an authenticator app.
If the next step is `continueSignInWithMFASetupSelection`, the user must indicate which of the available MFA methods they would like to setup. After the user selects an MFA method to setup, your implementation must pass the selected MFA method to the `confirmSignIn` API.
If the next step is `confirmSignInWithCustomChallenge`, Amplify Auth is awaiting completion of a custom authentication challenge. The challenge is based on the Lambda trigger you setup when you configured a [custom sign in flow](/[platform]/build-a-backend/auth/customize-auth-lifecycle/custom-auth-flows/#sign-in-a-user). To complete this step, you should prompt the user for the custom challenge answer, and pass the answer to the `confirmSignIn` API.
1946
1946
@@ -2011,7 +2011,7 @@ Exception: notAuthorized{message=Failed since user is not authorized., cause=No
2011
2011
2012
2012
</Callout>
2013
2013
2014
-
### Confirm signin with new password
2014
+
## Confirm signin with new password
2015
2015
2016
2016
If the next step is `confirmSignInWithNewPassword`, Amplify Auth requires a new password for the user before they can proceed. Prompt the user for a new password and pass it to the `confirmSignIn` API.
If you receive `resetPassword`, authentication flow could not proceed without resetting the password. The next step is to invoke `resetPassword` api and follow the reset password flow.
If you receive `confirmSignUp` as a next step, sign up could not proceed without confirming user information such as email or phone number. The next step is to invoke the `confirmSignUp` API and follow the confirm signup flow.
Signin flow is complete when you get `done`. This means the user is successfully authenticated. As a convenience, the SignInResult also provides the `isSignedIn` property, which will be true if the next step is `done`.
0 commit comments