Managing external identities to enable secure access for partners, customers, and other non-employees
Hi @Dyasani, Ranjeeth (NonEmp) • Thank you for reaching out.
I understand you want to sign in to your application via B2C user flow/custom policy after successful 1st-factor authentication and then trigger only the 2nd-factor authentication when making API calls to access secure areas of your applications.
In this case, rather than using 2 separate policies, I would suggest you use only one policy and leverage Conditional Access. In the Conditional Access policy, including the app that is exposed as API and configure the CA policy to trigger MFA when API is accessed. On the other hand, as the app is not in the scope of the CA policy, MFA won't be triggered during sign-in to the app.
For your reference, I have created B2C_1_SuSi-Username policy configured with Conditional Access to protect both the App and the API. You can try performing the below steps in the same sequence:
- SignUp and SignIn to the App (click here).
- Use the same policy to get a token for the API within the same browser session (click here).
In this case, the App is not included in the CA policy but the API is included. So, MFA will be triggered only for the API and not for the App.
-----------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.