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 (nextStep.signInStep==='CONFIRM_SIGN_IN_WITH_PASSWORD') {
132
+
// collect password from user
133
+
awaitconfirmSignIn({
134
+
challengeResponse: 'hunter2',
135
+
});
136
+
}
137
+
138
+
if (nextStep.signInStep==='CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION') {
139
+
// present nextStep.availableChallenges to user
140
+
// collect user selection
141
+
awaitconfirmSignIn({
142
+
challengeResponse: 'SMS_OTP', // or 'EMAIL_OTP', 'WEB_AUTHN', 'PASSWORD', 'PASSWORD_SRP'
143
+
});
144
+
}
145
+
```
146
+
119
147
## Confirm sign-in with SMS MFA
120
148
121
149
If the next step is `CONFIRM_SIGN_IN_WITH_SMS_CODE`, 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.
Once the sign up is confirmed, call `signIn` again to restart the sign-in flow.
526
554
555
+
## Confirm sign-in with password
556
+
557
+
If the next step is `CONFIRM_SIGN_IN_WITH_PASSWORD`, the user must provide their password as the first factor authentication method. To handle this step, your app's UI must prompt the user to enter their password. After the user enters the password, pass the value to the `confirmSignIn` API.
const result =awaitconfirmSignIn({ challengeResponse: password });
574
+
575
+
returnhandleSignInResult(result);
576
+
}
577
+
```
578
+
579
+
## Continue sign-in with first factor selection
580
+
581
+
If the next step is `CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION`, the user must select the first factor method to use. Amplify Auth currently supports SMS, Email, WebAuthn passkey, and traditional password methods. After the user selects a frist factor method, your implementation must pass the selected method to Amplify Auth using the `confirmSignIn` API.
582
+
583
+
The first factor types which are currently supported by Amplify Auth are:
584
+
585
+
-`SMS_OTP`
586
+
-`EMAIL_OTP`
587
+
-`WEB_AUTHN`
588
+
-`PASSWORD`
589
+
-`PASSWORD_SRP`
590
+
591
+
Not all first factor types may be available based on your configuration. Only the allowed types will be presented in `availableChallenges` for selection.
592
+
593
+
Once Amplify receives the users selection, you can expect to handle a follow up `nextStep` corresponding with the selected factor type:
594
+
595
+
- If `SMS_OTP` is selected, `CONFIRM_SIGN_IN_WITH_SMS_CODE` will be the next step.
596
+
- If `EMAIL_OTP` is selected, `CONFIRM_SIGN_IN_WITH_EMAIL_CODE` will be the next step.
597
+
- If `WEB_AUTHN` is selected, `DONE` will be the next step.
598
+
- If `PASSWORD` or `PASSWORD_SRP` is selected, `CONFIRM_SIGN_IN_WITH_PASSWORD` will be the next step.
0 commit comments