My organisation uses azure b2c for logins. We are trying to implement Portal's Terms and Conditions feature and I've followed the tutorial and set the site setting to True and put my text in the content snippet. However once a user logs in it turns into a constant loop between the Login/TermsandConditions page and b2c redirect. The entire page stays white. Has anyone else encountered this before and know the fix?
Yes, this infinite loop between login/terms and Azure B2C redirect after enabling Power Pages' Terms and Conditions is a common issue—it's often caused by the portal's native auth flow clashing with B2C's external handling, especially if the contact's terms agreement date isn't cleared, leading to repeated redirects on a white screen. The fix is straightforward and OOB: ensure the terms consent is properly wired post-B2C auth, without conflicting configs.
Quick Solution Steps
1.Verify Site Settings in Portal Management:
Go to Site Settings > search for Authentication/Registration/TermsAgreementEnabled > set Value to true (if not already).
Optionally, add Authentication/Registration/TermsPublicationDate with today's ISO date (e.g., 2025-11-04T00:00:00Z) to control re-prompting.
Save and sync your portal in Power Pages design studio (use Restart site under Advanced to clear cache).​
2.Set Up the Terms Content Snippet:
In Content Snippets, find or create Account/Signin/TermsAndConditionsCopy > set Type to Text (or Html for formatting), paste your terms text, and publish.
For customization: Add snippets like Account/Signin/TermsAndConditionsHeading (e.g., "Terms and Conditions"), Account/Signin/TermsAndConditionsAgreementText (e.g., "I agree to these terms"), and Account/Signin/TermsAndConditionsButtonText (e.g., "Continue").
Ensure the snippet's MIME Type is text/html if using HTML—save and publish all.
3.Clear Contact's Terms Agreement Date:
This is key for the loop: In Contacts (Dataverse table), find the user/contact > open record > clear the adx_portaltermsagreementdate field (or Portal Terms Agreement Date) > save.
For new users, test in an incognito window. The dialog should now appear after B2C login but before full portal access—accepting sets the date and breaks the loop
4.B2C Config Check (If Needed):
In Azure portal > B2C tenant > User flows > your sign-up/sign-in flow > Page layouts > upload custom HTML if overriding (include terms link via "Terms of use URL" for B2C-side consent to avoid portal duplication).
Ensure the Reply URL in B2C app registration matches your portal's exact post-login redirect (e.g., https://yourportal.powerpages.microsoft.com/), and no extra state params are causing loops.
5.Test and Troubleshoot:
Sign out completely > clear browser cache/cookies > attempt login. Post-B2C, you should see the terms modal (not loop), accept, and land on home.
If still looping: Check browser console (F12) for errors like auth state mismatches; temporarily disable terms (false in site setting) to isolate B2C flow, then re-enable. Also, confirm no custom JS or policies in B2C are interfering with post-auth redirects.​
For white screen: Restart the site again and verify B2C issuer URL in portal settings (Authentication/OpenIdConnect/YourB2CFlowName/Issuer).​
This setup keeps terms in the portal flow after B2C (recommended for sticky consent), resolving the loop without code.
Best Regards,
Jerald Felix
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.