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
Copy file name to clipboardExpand all lines: src/pages/[platform]/build-a-backend/auth/connect-your-frontend/switching-authentication-flows/index.mdx
+32-15Lines changed: 32 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,18 +171,9 @@ await signIn({
171
171
172
172
## USER_AUTH flow
173
173
174
-
The `USER_AUTH` sign in flow will support the following methods of first factor authentication: `WEB_AUTHN`, `EMAIL_OTP`, `SMS_OTP`, `PASSWORD`, and `PASSWORD_SRP`.
174
+
The `USER_AUTH` sign in flow supports the following methods as first factors for authentication: `WEB_AUTHN`, `EMAIL_OTP`, `SMS_OTP`, `PASSWORD`, and `PASSWORD_SRP`.
175
175
176
-
```ts
177
-
typeAuthFactorType=
178
-
|"WEB_AUTHN"
179
-
|"EMAIL_OTP"
180
-
|"SMS_OTP"
181
-
|"PASSWORD"
182
-
|"PASSWORD_SRP";
183
-
```
184
-
185
-
If the desired first factor is known before the sign in flow is initiated it can be passed to the initial sign in call.
176
+
If the desired first factor is known when authentication is initiated it can be passed to the `signIn` API as the `preferredChallenge` to initiate the corresponding authentication flow.
preferredChallenge: "WEB_AUTHN"// or "EMAIL_OTP" or "SMS_OTP"
208
199
},
209
200
});
210
201
```
211
202
212
-
If the desired first factor is not known, the flow will continue to select an available first factor.
203
+
If the desired first factor is not known or you would like to provide users with available options, it can be omitted from the initial `signIn` API call to discover which authentication first factors are available for a user via the `CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION` step.
challengeResponse: 'SMS_OTP', // or 'EMAIL_OTP', 'WEB_AUTHN', 'PASSWORD', 'PASSWORD_SRP'
222
+
});
223
+
}
224
+
225
+
```
226
+
Also, note that if the `preferredChallenge` passed to the initial `signIn` API call is unavailable for the user, Amplify will also respond with the `CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION` next step.
227
+
213
228
214
-
> For more information about determining a first factor, and signing in with passwordless authorization factors, please visit the [concepts page for passwordless](/[platform]/build-a-backend/auth/concepts/passwordless/)
229
+
<Callout>
230
+
For more information about determining a first factor, and signing in with passwordless authentication factors, please visit the [Passwordless](/[platform]/build-a-backend/auth/concepts/passwordless/) concepts page.
0 commit comments