question

JimTaliadoros-2724 avatar image
0 Votes"
JimTaliadoros-2724 asked amanpreetsingh-msft answered

Migrating b2c asp.net framework website from login.microsoft to b2clogin domain

Hi

I have an asp.net framework 4.7.2 site up and running that uses the deprecated login.microsoft domain. Following the suggested guidance I've upgraded my code use the new b2clogin domain.

My Auth.startup class registers middleware for each of the policies I need. Eg sign-in, sign-up, reset etc.

Trouble is I can no longer seem to invoke any of the policy flows from my account controller anymore as specifying an sign-up policy I'm the getowen.context no longer works.

Does.anyone know of a good sample or article that explains how to invoke the various policy user flows from an asp.net controller using the new b2clogin domain ?

azure-ad-b2cazure-ad-adal-deprecation
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

amanpreetsingh-msft avatar image
0 Votes"
amanpreetsingh-msft answered

Hi @JimTaliadoros-2724 · Thank you for reaching out.

For this purpose, please refer to the sample here: https://github.com/Azure-Samples/active-directory-b2c-dotnet-webapp-and-webapi

If you're using MSAL.NET v2 or earlier, set the ValidateAuthority property to false on client instantiation to allow redirects to b2clogin.com. Setting this value to false is not required for MSAL.NET v3 and above.

 ConfidentialClientApplication client = new ConfidentialClientApplication(...); // Can also be PublicClientApplication
 client.ValidateAuthority = false; // MSAL.NET v2 and earlier **ONLY**


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.