Skip to content

Commit 6bdc842

Browse files
committed
Use InlineFilters to populate correct variable names for Android
1 parent 39b9034 commit 6bdc842

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/fragments/lib/auth/common/mfa/flows.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,23 @@ You can use Time-based One-Time Password (TOTP) for multi-factor authentication
219219

220220
### Setting up TOTP for a user
221221

222+
<InlineFilter filters={['android']}>
223+
After you initiate a user sign in with the `signIn` API where a user is required to set up TOTP as an MFA method, the API call will return `CONTINUE_SIGN_IN_WITH_TOTP_SETUP` as a challenge and next step to handle in your app. You will get that challenge if the following conditions are met:
224+
</InlineFilter>
225+
<InlineFilter filters={['swift', 'flutter']}>
222226
After you initiate a user sign in with the `signIn` API where a user is required to set up TOTP as an MFA method, the API call will return `continueSignInWithTOTPSetup` as a challenge and next step to handle in your app. You will get that challenge if the following conditions are met:
227+
</InlineFilter>
223228

224229
- MFA is marked as **Required** in Cognito User Pool.
225230
- TOTP is enabled in the Cognito User Pool
226231
- User does not have TOTP MFA set up already.
227232

233+
<InlineFilter filters={['android']}>
234+
The `CONTINUE_SIGN_IN_WITH_TOTP_SETUP` step signifies that the user must set up TOTP before they can sign in. The step returns an associated value of type `TOTPSetupDetails` which must be used to configure an authenticator app like Microsoft Authenticator or Google Authenticator. `TOTPSetupDetails` provides a helper method called `getSetupURI` which generates a URI that can be used, for example, in a button to open the user's installed authenticator app. For more advanced use cases, `TOTPSetupDetails` also contains a `sharedSecret` which can be used to either generate a QR code or be manually entered into an authenticator app.
235+
</InlineFilter>
236+
<InlineFilter filters={['swift', 'flutter']}>
228237
The `continueSignInWithTOTPSetup` step signifies that the user must set up TOTP before they can sign in. The step returns an associated value of type `TOTPSetupDetails` which must be used to configure an authenticator app like Microsoft Authenticator or Google Authenticator. `TOTPSetupDetails` provides a helper method called `getSetupURI` which generates a URI that can be used, for example, in a button to open the user's installed authenticator app. For more advanced use cases, `TOTPSetupDetails` also contains a `sharedSecret` which can be used to either generate a QR code or be manually entered into an authenticator app.
238+
</InlineFilter>
229239

230240
Once the authenticator app is set up, the user can generate a TOTP code and provide it to the library to complete the sign in process.
231241

@@ -599,7 +609,12 @@ Future<void> updateMfaPreferences() async {
599609

600610
</InlineFilter>
601611

612+
<InlineFilter filters={['android']}>
613+
If multiple MFA methods are enabled for the user, the `signIn` API will return `CONTINUE_SIGN_IN_WITH_MFA_SELECTION` as the next step in the auth flow. During this scenario, the user should be prompted to select the MFA method they want to use to sign in and their preference should be passed to `confirmSignIn`.
614+
</InlineFilter>
615+
<InlineFilter filters={['swift', 'flutter']}>
602616
If multiple MFA methods are enabled for the user, the `signIn` API will return `continueSignInWithMFASelection` as the next step in the auth flow. During this scenario, the user should be prompted to select the MFA method they want to use to sign in and their preference should be passed to `confirmSignIn`.
617+
</InlineFilter>
603618

604619
import iosContinueSignInWithMFASelection from '/src/fragments/lib/auth/ios/signin_next_steps/91_continue_mfa_selection_code.mdx';
605620

src/fragments/lib/auth/native_common/signin_next_steps/common.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ import flutter1 from '/src/fragments/lib/auth/flutter/signin_next_steps/20_confi
3535

3636
### Confirm signin with TOTP MFA
3737

38+
<InlineFilter filters={['android']}>
39+
If the next step is `CONFIRM_SIGN_IN_WITH_TOTP_CODE`, you should prompt the user to enter the TOTP code from their associated authenticator app during set up. The code is a six-digit number that changes every 30 seconds. The user must enter the code before the 30-second window expires.
40+
</InlineFilter>
41+
<InlineFilter filters={['swift', 'flutter']}>
3842
If the next step is `confirmSignInWithTOTPCode`, you should prompt the user to enter the TOTP code from their associated authenticator app during set up. The code is a six-digit number that changes every 30 seconds. The user must enter the code before the 30-second window expires.
43+
</InlineFilter>
3944

4045
After the user enters the code, your implementation must pass the value to Amplify Auth `confirmSignIn` API.
4146

@@ -164,7 +169,12 @@ Future<void> confirmTotpUser(String totpCode) async {
164169

165170
### Continue signin with MFA Selection
166171

172+
<InlineFilter filters={['android']}>
173+
If the next step is `CONTINUE_SIGN_IN_WITH_MFA_SELECTION`, the user must select the MFA method to use. Amplify Auth currently only supports SMS and TOTP as MFA methods. After the user selects an MFA method, your implementation must pass the selected MFA method to Amplify Auth using `confirmSignIn` API.
174+
</InlineFilter>
175+
<InlineFilter filters={['swift', 'flutter']}>
167176
If the next step is `continueSignInWithMFASelection`, the user must select the MFA method to use. Amplify Auth currently only supports SMS and TOTP as MFA methods. After the user selects an MFA method, your implementation must pass the selected MFA method to Amplify Auth using `confirmSignIn` API.
177+
</InlineFilter>
168178

169179
import iosContinueSignInWithMFASelectionCode from 'src/fragments/lib/auth/ios/signin_next_steps/91_continue_mfa_selection_code.mdx';
170180

@@ -280,7 +290,12 @@ Future<void> _handleMfaSelection(MfaType selection) async {
280290

281291
### Continue signin with TOTP Setup
282292

293+
<InlineFilter filters={['android']}>
294+
If the next step is `CONTINUE_SIGN_IN_WITH_TOTP_SETUP`, then the user must provide a TOTP code to complete the sign in process. The step returns an associated value of type `TOTPSetupDetails` which would be used for generating TOTP. `TOTPSetupDetails` provides a helper method called `getSetupURI` that can be used to generate a URI, which can be used by native password managers for TOTP association. For example. if the URI is used on Apple platforms, it will trigger the platform's native password manager to associate TOTP with the account. For more advanced use cases, `TOTPSetupDetails` also contains the `sharedSecret` that will be used to either generate a QR code or can be manually entered into an authenticator app.
295+
</InlineFilter>
296+
<InlineFilter filters={['swift', 'flutter']}>
283297
If the next step is `continueSignInWithTOTPSetup`, then the user must provide a TOTP code to complete the sign in process. The step returns an associated value of type `TOTPSetupDetails` which would be used for generating TOTP. `TOTPSetupDetails` provides a helper method called `getSetupURI` that can be used to generate a URI, which can be used by native password managers for TOTP association. For example. if the URI is used on Apple platforms, it will trigger the platform's native password manager to associate TOTP with the account. For more advanced use cases, `TOTPSetupDetails` also contains the `sharedSecret` that will be used to either generate a QR code or can be manually entered into an authenticator app.
298+
</InlineFilter>
284299

285300
Once the authenticator app is set up, the user can generate a TOTP code and provide it to the library to complete the sign in process.
286301

0 commit comments

Comments
 (0)