0
votes

I'm fairly new to Azure and therefore with Azure Active Directory B2C (AAD B2C).

I've tried their tutorial and it worked as it was supposed to. Now I'm trying to integrate this flow into a more complex application.

Tutorial: https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-devquickstarts-web-dotnet

I've had some trouble to disable the existing authentication, but I finally got anonymously onto an application page. I've added everything like the tutorial says (as in my demo) but for some reason the AAD B2C doesn't authenticate anymore.

What happens is: the Action in AccountController.cs starts and executes the Owin call

HttpContext.GetOwinContext().Authentication.Challenge(
                    new AuthenticationProperties() { RedirectUri = "/" }, Startup.SignUpPolicyId);

Instead of showing the SignUp page of AAD B2C it quickly redirects to the ReplyUrl (localhost:58888)

When back on my page, I try to loop through the claims, but there is only 1 empty name claim (should be 4 different claims).

I've already cleared cache and cookies but nothing changes. I don't know anymore where to start looking for a solution.

If you need more info/code, I'll happily provide.

1

1 Answers

1
votes

The fact that the AAD B2C immediately sent the user to the ReplyUrl before even authenticating, was due to the fact that the ReplyUrl defined in Azure didn't match with the redirectUrl defined in the Web.config file.

I missed that somewhere apparently.