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
+89-4
Original file line number
Diff line number
Diff line change
@@ -259,8 +259,10 @@ The `signIn` API response will include a `nextStep` property, which can be used
259
259
|`CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED`| The user was created with a temporary password and must set a new one. Complete the process with `confirmSignIn`. |
260
260
|`CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE`| The sign-in must be confirmed with a custom challenge response. Complete the process with `confirmSignIn`. |
261
261
|`CONFIRM_SIGN_IN_WITH_TOTP_CODE`| The sign-in must be confirmed with a TOTP code from the user. Complete the process with `confirmSignIn`. |
262
-
|`CONFIRM_SIGN_IN_WITH_SMS_CODE`| The sign-in must be confirmed with a SMS code from the user. Complete the process with `confirmSignIn`. |
263
-
|`CONFIRM_SIGN_IN_WITH_EMAIL_CODE`| The sign-in must be confirmed with a EMAIL code from the user. Complete the process with `confirmSignIn`. |
262
+
|`CONFIRM_SIGN_IN_WITH_SMS_CODE`| The sign-in must be confirmed with an SMS code from the user. Complete the process with `confirmSignIn`. |
263
+
|`CONFIRM_SIGN_IN_WITH_EMAIL_CODE`| The sign-in must be confirmed with an EMAIL code from the user. Complete the process with `confirmSignIn`. |
264
+
|`CONFIRM_SIGN_IN_WITH_PASSWORD`| The sign-in must be confirmed with the password from the user. Complete the process with `confirmSignIn`. |
265
+
|`CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION`| The user must select their mode of first factor authentication. Complete the process by passing the desired mode to the `challengeResponse` field of `confirmSignIn`. |
264
266
|`CONTINUE_SIGN_IN_WITH_MFA_SELECTION`| The user must select their mode of MFA verification before signing in. Complete the process with `confirmSignIn`. |
265
267
|`CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION`| The user must select their mode of MFA verification to setup. Complete the process by passing either `"EMAIL"` or `"TOTP"` to `confirmSignIn`. |
266
268
|`CONTINUE_SIGN_IN_WITH_TOTP_SETUP`| The TOTP setup process must be continued. Complete the process with `confirmSignIn`. |
@@ -591,6 +593,8 @@ Following sign in, you will receive a `nextStep` in the sign-in result of one of
591
593
|`CONFIRM_SIGN_IN_WITH_TOTP_CODE`| The sign-in must be confirmed with a TOTP code from the user. Complete the process with `confirmSignIn`. |
592
594
|`CONFIRM_SIGN_IN_WITH_SMS_CODE`| The sign-in must be confirmed with a SMS code from the user. Complete the process with `confirmSignIn`. |
593
595
|`CONFIRM_SIGN_IN_WITH_EMAIL_CODE`| The sign-in must be confirmed with a EMAIL code from the user. Complete the process with `confirmSignIn`. |
596
+
|`CONFIRM_SIGN_IN_WITH_PASSWORD`| The sign-in must be confirmed with the password from the user. Complete the process with `confirmSignIn`. |
597
+
|`CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION`| The user must select their mode of first factor authentication. Complete the process by passing the desired mode to the `challengeResponse` field of `confirmSignIn`. |
594
598
|`CONTINUE_SIGN_IN_WITH_MFA_SELECTION`| The user must select their mode of MFA verification before signing in. Complete the process with `confirmSignIn`. |
595
599
|`CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION`| The user must select their mode of MFA verification to setup. Complete the process by passing either `"EMAIL"` or `"TOTP"` to `confirmSignIn`. |
596
600
|`CONTINUE_SIGN_IN_WITH_TOTP_SETUP`| The TOTP setup process must be continued. Complete the process with `confirmSignIn`. |
@@ -1113,7 +1117,18 @@ Your application's users can also sign in using passwordless methods. To learn m
Traditional password based authentication is available from this flow as well. To initiate this flow from select challenge, either `PASSWORD` or `PASSWORD_SRP` is passed as the challenge response.
1359
+
1360
+
```ts
1361
+
const { nextStep } =awaitconfirmSignIn({
1362
+
challengeResponse: "PASSWORD_SRP", // or "PASSWORD"
For client side authentication there are three different flows:
148
+
For client side authentication there are four different flows:
149
149
150
-
1.`USER_SRP_AUTH`: The `USER_SRP_AUTH` flow uses the [SRP protocol (Secure Remote Password)](https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol) where the password never leaves the client and is unknown to the server. This is the recommended flow and is used by default.
150
+
1.`USER_AUTH`: The `USER_AUTH` flow is designed to be flexible and supports both password and passwordless sign in factors. `USER_AUTH` can do username-password and SRP authentication without the other flows being configured. This flow doesn't include CUSTOM_AUTH. This is the recommended flow.
151
151
152
-
2.`USER_PASSWORD_AUTH`: The `USER_PASSWORD_AUTH` flow will send user credentials to the backend without applying SRP encryption. If you want to migrate users to Cognito using the "Migration" trigger and avoid forcing users to reset their passwords, you will need to use this authentication type because the Lambda function invoked by the trigger needs to verify the supplied credentials.
152
+
2.`USER_SRP_AUTH`: The `USER_SRP_AUTH` flow uses the [SRP protocol (Secure Remote Password)](https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol) where the password never leaves the client and is unknown to the server.
153
153
154
-
3.`CUSTOM_WITH_SRP` & `CUSTOM_WITHOUT_SRP`: Allows for a series of challenge and response cycles that can be customized to meet different requirements.
154
+
3.`USER_PASSWORD_AUTH`: The `USER_PASSWORD_AUTH` flow will send user credentials unencrypted to the backend. If you want to migrate users to Cognito using the "Migration" trigger and avoid forcing users to reset their passwords, you will need to use this authentication type because the Lambda function invoked by the trigger needs to verify the supplied credentials.
155
+
156
+
4.`CUSTOM_WITH_SRP` & `CUSTOM_WITHOUT_SRP`: Allows for a series of challenge and response cycles that can be customized to meet different requirements.
155
157
156
158
The Auth flow can be customized when calling `signIn`, for example:
> For more information about authentication flows, please visit [AWS 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)
169
171
172
+
## USER_AUTH flow
173
+
174
+
In order to facilitate the new passwordless sign in options, Cognito is introducing a new auth flow type known as `USER_AUTH`. This flow is designed to be flexible and supports both password and passwordless sign in factors.
175
+
176
+
### Set up auth backend
177
+
178
+
Configure supported flows in your Cognito app client. In the AWS Console, this is done by ticking the checkboxes at General settings > App clients > App client information (Edit) > App client flows. If you're using the AWS CLI or CloudFormation, update your app client by adding `USER_AUTH` to the list of "Explicit Auth Flows".
179
+
180
+
### User authentication flow
181
+
182
+
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`.
183
+
184
+
```ts
185
+
typeAuthFactorType=
186
+
|"WEB_AUTHN"
187
+
|"EMAIL_OTP"
188
+
|"SMS_OTP"
189
+
|"PASSWORD"
190
+
|"PASSWORD_SRP";
191
+
```
192
+
193
+
If the desired first factor is known before the sign in flow is initiated it can be passed to the initial sign in call.
194
+
195
+
Password flows will require the password to be passed in the same step. Passwordless flows do not require user input, and the challenges will be handled in the next sign in step:
preferredChallenge: "WEB_AUTHN"// or "EMAIL_OTP" or "SMS_OTP"
218
+
},
219
+
});
220
+
```
221
+
222
+
If the desired first factor is not known, the flow will continue to select an available first factor.
223
+
224
+
> 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/)
225
+
170
226
## USER_PASSWORD_AUTH flow
171
227
172
228
A use case for the `USER_PASSWORD_AUTH` authentication flow is migrating users into Amazon Cognito
0 commit comments