Managing external identities to enable secure access for partners, customers, and other non-employees
Hello viswanadham paila,
In Azure AD B2C custom policies, there is no built-in tenant-level or global configuration flag that can be defined in the portal and directly read inside a policy for orchestration logic.
Important clarifications:
- Policy Keys are only for secrets (certificates, client secrets, API keys). They cannot be read as claims and cannot be used in orchestration step preconditions, so they are not suitable for feature flags.
- Custom policies can evaluate only claims present in the claims bag. If a value is not a claim, it cannot control MFA execution. Recommended and supported approach
The recommended pattern is to externalize the flag and retrieve it dynamically via a REST API during policy execution:
- Store your MFA flags (
isMFARequiredForSignIn,isMFARequiredForStepUp) in an external system (for example: Azure App Configuration, database, or configuration service). - Call that service using a RESTful technical profile early in the user journey.
- Return the flag values as Boolean output claims.
- Use Orchestration Step Preconditions (
ClaimEquals) to skip or execute the MFA step. - (Optional) Include the flag claims in the issued token.
This allows you to enable or disable MFA dynamically without modifying or redeploying the policy XML.
Example logic:
JSON
If isMFARequiredForSignIn = true → execute MFA orchestration step
If isMFARequiredForSignIn = false → skip MFA orchestration step
``
The same pattern applies independently to your step‑up flow using a separate flag (isMFARequiredForStepUp).
Why this is best practice
- No policy redeployment when flags change
- Full control via configuration outside B2C
- Clean separation of policy logic and runtime decisions
- Fully supported and commonly used for dynamic behavior in custom policies Alternatives (with limitations)
- Selecting different policies from the application (MFA vs non‑MFA) – requires app changes
- Using per‑user attributes – works for user‑specific MFA, not for global tenant flags
https://learn.microsoft.com/en-us/azure/active-directory-b2c/custom-policies-series-call-rest-api
https://learn.microsoft.com/en-us/azure/active-directory-b2c/restful-technical-profile
I kindly request you to please let me know and comment if this doesn’t fully address your question or if you need any additional information. I’ll be happy to assist you further.