Hi @Alois.Goeth
You have enabled Adaptive MFA for your application, but the Apple App Store review team's test account is being flagged as risky and required to complete MFA. Since the reviewer cannot access the email mailbox for the verification code, the review is blocked. You want to exclude this specific test account from Adaptive MFA while keeping it enabled for all other users.
Yes, you can disable Adaptive MFA for a specific test account by adding a flag to the account's app_metadata and creating a Post-Login Action that checks for this flag. This allows you to exempt the test account from MFA while keeping Adaptive MFA enabled for all other users.
[Root Cause]
Adaptive MFA is enabled globally for your application, which means all users—including the test account—are subject to risk assessment. When the test account is flagged as risky, Auth0 requires MFA completion. Since the reviewer cannot access the email mailbox, they cannot retrieve the verification code and cannot proceed.
Solution: Exempt the Test Account from Adaptive MFA Using a Post-Login Action
Step 1: Add a Flag to the Test Account's app_metadata
- Navigate to Auth0 Dashboard → Users & Roles → Users
- Find and click the test account (the one used by Apple reviewers)
- Scroll down to the app_metadata section
- Add the following JSON:
{
"skip_mfa": true
}
- Click Save
Step 2: Enable "Customize MFA using Actions"
This setting allows your Post-Login Action to override Adaptive MFA:
- Navigate to Auth0 Dashboard → Security → Multi-factor Auth
- Scroll down to Customize MFA using Actions
- Toggle it ON
- Save
Step 3: Create a Post-Login Action to Skip MFA for the Test Account
- Navigate to Actions → Library → Create Action
- Name it "Skip MFA for Test Accounts"
- Select "Login / Post-Login" as the trigger
- Add the following code:
exports.onExecutePostLogin = async (event, api) => {
// Check if the user has skip_mfa flag in app_metadata
if (event.user.app_metadata && event.user.app_metadata.skip_mfa === true) {
// Disable MFA for this user
api.multifactor.enable('none');
console.log(`MFA skipped for user: ${event.user.email}`);
return;
}
// For all other users, Adaptive MFA continues to work as configured
};
- Deploy the Action
Step 4: Add the Action to Your Login Flow
- Navigate to Actions → Flows → Login
- Drag and drop your "Skip MFA for Test Accounts" Action into the flow
- Save the flow
Step 5: Test the Setup
- Log in with the test account — You should NOT be prompted for MFA
- Log in with a regular user account — Adaptive MFA should still work as expected
- Verify the test account can complete the Apple review without MFA interruption
Alternative: Use User Metadata Instead of app_metadata
If you prefer to use user_metadata instead of app_metadata:
exports.onExecutePostLogin = async (event, api) => {
// Check if the user has skip_mfa flag in user_metadata
if (event.user.user_metadata && event.user.user_metadata.skip_mfa === true) {
api.multifactor.enable('none');
console.log(`MFA skipped for user: ${event.user.email}`);
return;
}
};
Important Notes:
- app_metadata is recommended — Use
app_metadata instead of user_metadata because users have read-only access to app_metadata and cannot modify it themselves, whereas they can modify user_metadata. This prevents the test account from re-enabling MFA on their own.
- Adaptive MFA remains active for other users — Only the test account with
skip_mfa: true will bypass MFA. All other users will continue to experience Adaptive MFA as configured.
- Remove the flag after review — Once Apple completes the review, remove the
skip_mfa: true flag from the test account's app_metadata to re-enable MFA protection.
- Multiple test accounts — If you have multiple test accounts that need to skip MFA, add the
skip_mfa: true flag to each account's app_metadata.
Troubleshooting:
- MFA is still being triggered — Ensure you have enabled "Customize MFA using Actions" in the Security → Multi-factor Auth settings
- Action is not running — Verify the Action is deployed and added to the Login flow
- app_metadata is not saving — Make sure you are editing the correct user and clicking Save after adding the JSON
Security Recommendation:
After the Apple review is complete, remove the skip_mfa: true flag from the test account to restore MFA protection. You can re-add it for future reviews if needed.
This approach allows you to provide Apple with a fully functional test account that bypasses MFA while maintaining Adaptive MFA protection for all production users.
Kind Regards,
Nik