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/sign-in/index.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -295,6 +295,8 @@ The `signIn` API response will include a `nextStep` property, which can be used
295
295
|`confirmSignInWithTOTPCode`| The sign-in must be confirmed with a TOTP code from the user. Complete the process with `confirmSignIn`. |
296
296
|`confirmSignInWithSMSMFACode`| The sign-in must be confirmed with a SMS code from the user. Complete the process with `confirmSignIn`. |
297
297
|`confirmSignInWithOTP`| The sign-in must be confirmed with a code from the user (sent via SMS or Email). Complete the process with `confirmSignIn`. |
298
+
|`confirmSignInWithPassword`| The user must set a new password. Complete the process with `confirmSignIn`. |
299
+
|`continueSignInWithFirstFactorSelection`| The user must select their preferred mode of First Factor authentication. Complete the process with `confirmSignIn`. |
298
300
|`continueSignInWithMFASelection`| The user must select their mode of MFA verification before signing in. Complete the process with `confirmSignIn`. |
299
301
|`continueSignInWithMFASetupSelection`| The user must select their mode of MFA verification to setup. Complete the process by passing either `MFAType.email.challengeResponse` or `MFAType.totp.challengeResponse ` to `confirmSignIn`. |
300
302
|`continueSignInWithTOTPSetup`| The TOTP setup process must be continued. Complete the process with `confirmSignIn`. |
@@ -615,6 +617,8 @@ Following sign in, you will receive a `nextStep` in the sign-in result of one of
615
617
|`confirmSignInWithTOTPCode`| The sign-in must be confirmed with a TOTP code from the user. Complete the process with `confirmSignIn`. |
616
618
|`confirmSignInWithSMSMFACode`| The sign-in must be confirmed with a SMS code from the user. Complete the process with `confirmSignIn`. |
617
619
|`confirmSignInWithOTP`| The sign-in must be confirmed with a code from the user (sent via SMS or Email). Complete the process with `confirmSignIn`. |
620
+
|`confirmSignInWithPassword`| The user must set a new password. Complete the process with `confirmSignIn`. |
621
+
|`continueSignInWithFirstFactorSelection`| The user must select their preferred mode of First Factor authentication. Complete the process with `confirmSignIn`. |
618
622
|`continueSignInWithMFASelection`| The user must select their mode of MFA verification before signing in. Complete the process with `confirmSignIn`. |
619
623
|`continueSignInWithMFASetupSelection`| The user must select their mode of MFA verification to setup. Complete the process by passing either `MFAType.email.challengeResponse` or `MFAType.totp.challengeResponse ` to `confirmSignIn`. |
620
624
|`continueSignInWithTOTPSetup`| The TOTP setup process must be continued. Complete the process with `confirmSignIn`. |
Copy file name to clipboardExpand all lines: src/pages/[platform]/build-a-backend/auth/connect-your-frontend/switching-authentication-flows/index.mdx
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,8 @@ For client side authentication there are four different flows that can be config
40
40
41
41
4.`customWithoutSRP`: The `customWithoutSRP` flow is used to start authentication flow **WITHOUT** SRP and then use a series of challenge and response cycles that can be customized to meet different requirements.
42
42
43
+
5.`userAuth`: The `userAuth` flow is a choice-based authentication flow that allows the user to choose from the list of available authentication methods. This flow is useful when you want to provide the user with the option to choose the authentication method. The choices that may be available to the user are `emailOTP`, `smsOTP`, `webAuthn`, `password` or `passwordSRP`.
44
+
43
45
`Auth` can be configured to use the different flows at runtime by calling `signIn` with `AuthSignInOptions`'s `authFlowType` as `AuthFlowType.userPassword`, `AuthFlowType.customAuthWithoutSrp` or `AuthFlowType.customAuthWithSrp`. If you do not specify the `AuthFlowType` in `AuthSignInOptions`, the default flow (`AuthFlowType.userSRP`) will be used.
44
46
45
47
<Callout>
@@ -50,6 +52,31 @@ Runtime configuration will take precedence and will override any auth flow type
50
52
51
53
> For more information about authentication flows, please visit [Amazon Cognito developer documentation](https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-authentication-flow.html#amazon-cognito-user-pools-custom-authentication-flow)
52
54
55
+
## USER_AUTH (Choice-based authentication) flow
56
+
57
+
A use case for the `USER_AUTH` authentication flow is to provide the user with the option to choose the authentication method. The choices that may be available to the user are `emailOTP`, `smsOTP`, `webAuthn`, `password` or `passwordSRP`.
The selection of the authentication method is done by the user. The user can choose from the available factors and proceed with the selected factor. You should call the `confirmSignIn` API with the selected factor to continue the sign-in process. Followign is an example if you want to proceed with the `emailOTP` factor selection:
73
+
74
+
```swift
75
+
// Select emailOTP as the factor
76
+
var confirmSignInResult =tryawait Amplify.Auth.confirmSignIn(
0 commit comments