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]/deploy-and-host/sandbox-environments/seed/index.mdx
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,10 @@ This will create a user with the username and password you provided and add them
137
137
138
138
The `getSecret` function will fetch the secret you created using `npx ampx sandbox secret set`. This allows you to avoid hardcoding credentials in your code. Alternatively, the username and password can be set directly as a `string` in the `createAndSignUpUser` function, but we highly recommend using `getSecret` to avoid exposing sensitive information in your repository.
139
139
140
+
### Multi-Factor Authentication (MFA)
141
+
142
+
Amplify seed supports multiple types of MFA including TOTP (Time-based One-Time Password), Email, and SMS. Below are examples of how to implement MFA in your seed script.
143
+
140
144
### Auth with TOTP MFA
141
145
142
146
For example, if you would like to seed your auth with a user with TOTP MFA enabled, lets start by configuring the auth resource:
@@ -288,13 +292,10 @@ auth.signOut();
288
292
289
293
This will create a user with the username and password with Email MFA enabled. The user will then be signed in and prompted for the MFA code in the command line.
SMS MFA follows the same pattern as Email MFA, using command line prompts for verification. Just replace `mfaPreference: "EMAIL"` with `mfaPreference: "SMS"` in your configuration. The command line experience will be identical, prompting for the SMS code instead of the email code.
@@ -597,7 +598,7 @@ Auth APIs allow you to create and manage users in your sandbox environment and a
597
598
The `@aws-amplify/seed` package provides these essential types:
598
599
599
600
-`AuthSignUp` - Type for user sign-up configuration
600
-
-`AuthUser` - Type for user authentication information
601
+
-`AuthUser` - Type for user sign in
601
602
-`ChallengeResponse` - Type for MFA challenge responses
602
603
-`StandardUserAttributes` - Type for managing user attributes during sign-up
0 commit comments