Here’s the complete solution for fixing Azure AD B2B MFA loops in D365 Lease Management:
Root Cause Analysis:
The MFA loop occurs because your conditional access policy with ‘Sign-in frequency: Every time’ treats each D365 action (document access, report navigation, form submission) as a separate resource request requiring fresh authentication. For B2B guest users, this is compounded by cross-tenant token validation, creating the endless MFA cycle.
Azure AD B2B Policy Configuration:
Create a dedicated conditional access policy for external users:
- Navigate to Azure AD > Security > Conditional Access > New Policy
- Name it ‘B2B Guest Access - D365 Lease Management’
- Under Assignments > Users: Select ‘Guest or external users’ > ‘B2B collaboration guest users’
- Under Cloud apps: Select ‘Microsoft Dynamics 365’ or your specific D365 app registration
- Under Conditions > Locations: Include ‘Any location’ but consider excluding trusted locations if applicable
MFA and Session Controls:
Configure balanced authentication requirements:
- Under Access controls > Grant: Select ‘Grant access’ and check ‘Require multi-factor authentication’
- Under Session controls:
- Sign-in frequency: Set to ‘4 hours’ (or 8 hours for less sensitive environments)
- Persistent browser session: Set to ‘Always persistent’
- This maintains the authenticated session across D365 resource accesses
External User Trust Settings:
Adjust cross-tenant access settings to prevent policy conflicts:
- Go to Azure AD > External Identities > Cross-tenant access settings
- Under ‘Default settings’, click ‘Edit inbound defaults’
- Under ‘Trust settings’, enable ‘Trust multi-factor authentication from Azure AD tenants’
- This allows MFA performed in the guest’s home tenant to satisfy your policy requirements
- Optionally enable ‘Trust compliant devices’ if your partners have device management
Conditional Access Policy Ordering:
Ensure proper policy precedence:
- Verify your new B2B policy has higher priority than the ‘Every time’ policy
- Modify your existing strict policy to explicitly exclude guest users
- Test with a single external user before rolling out to all vendors
Monitoring and Validation:
Set up monitoring to ensure the fix works:
- Enable sign-in logs for external users (Azure AD > Monitoring > Sign-in logs)
- Filter by ‘User type: Guest’ and monitor authentication frequency
- Check for any remaining authentication failures or loops
- Collect feedback from external users on their experience
Additional Security Layers:
Maintain security while improving usability:
- Implement app protection policies for D365 mobile access
- Enable Azure AD Identity Protection for risk-based access
- Configure named locations to restrict access from untrusted regions
- Set up alerts for unusual sign-in patterns from B2B guests
- Require terms of use acceptance for first-time B2B access
The 4-hour sign-in frequency with persistent browser sessions provides the right balance - external users authenticate once when starting their session, then work uninterrupted for 4 hours. Combined with MFA trust from their home tenant, this eliminates the loop while maintaining strong security posture for lease document access.
This draft is based on general Microsoft Dynamics 365 knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.