- Newest
- Most votes
- Most comments
Based on the information available, it appears that there isn't a straightforward way to use Cognito Managed Login screens to enroll an OTP authenticator device without requiring MFA for all users in the user pool. However, there are some approaches you can consider:
-
Optional MFA: You can set MFA to be optional in your user pool. When MFA is optional, the managed login doesn't automatically prompt users to set up MFA. However, this means you would need to build your own interface in your app to prompt users who want to set up MFA and guide them through the process using the appropriate API calls.
-
Custom UI: If you want more control over the MFA enrollment process, you might need to implement your own custom UI for device enrollment. This would allow you to selectively prompt users to enroll an authenticator device based on your specific criteria.
-
Adaptive Authentication: While not directly solving your issue, you could consider using adaptive authentication. This feature allows you to configure your user pool to require an additional authentication factor in response to an increased risk level. This might be a compromise between not requiring MFA for everyone and enhancing security for certain scenarios.
-
API-based approach: Although you mentioned that AdminSetUserMFAPreference didn't work as expected, you might need to combine multiple API calls to achieve your goal. For example, you could use a combination of API calls to set up the MFA preference and then trigger the enrollment process.
It's important to note that the Cognito Managed Login is designed to handle MFA enrollment automatically when MFA is required for the user pool. The lack of documentation for specific MFA enrollment endpoints outside the login flow suggests that this process is tightly coupled with the overall authentication flow.
Given these limitations, you may need to consider either implementing your own MFA enrollment UI or adjusting your authentication flow to accommodate the constraints of Cognito's managed login system. If this functionality is crucial for your use case, you might want to reach out to AWS support for more specific guidance or to request this feature.
Sources
Configure authentication methods for managed login - Amazon Cognito
Adding MFA to a user pool - Amazon Cognito
answered 2 years ago
Relevant content
asked 5 months ago
- AWS OFFICIALUpdated a year ago
