0
votes

I'm building an ASP Net Core 2.1 website using Azure AD B2C based on this example code. However, I am using the Microsoft-recommended b2clogin.com domain because the microsoftonline.com domain is being deprecated.

During signup, after the identity provider authenticates successfully, it should redirect the user to an Azure AD B2C generated page where the user fills in some additional fields. Those fields drawn from the standard attributes offered by Azure AD B2C (i.e., I haven't defined any custom attributes). Everything works as expected with Microsoft Account authentication.

However, when authenticating against Google, there is no redirect back to that Azure AD B2C generated page. Instead, the user is sent to the default page of the site.

I thought I set the proper redirect uri in the Google Cloud Console:

google cloud credentials

But since the redirect is not working, I'm wondering if I need to set it somewhere else.

1
Hi Mark. The redirect URL is correct; otherwise Google will be displaying an error message about an invalid redirect URL. I believe, if you capture the network traffic with the browser tools, then you'll see Google is returning to Azure AD B2C that then is returning to your application site. Are you using the same policy for both the Google and Microsoft Account sign-ups? - Chris Padgett
As far as I know I am, @ChrisPadgett. Then again, I didn't know you could use different policies for different identity providers until I read your comment. I just set up some policies (e.g., signin/up), which I presume are being used with all identity providers by default. - Mark Olbert

1 Answers

0
votes

Turns out the problem was caused by the fact that I had completely filled out the custom attributes page when logging in via the Google identity provider, but not the Microsoft Account identity provider. So all Google cared about was authenticating me, and then tossing me back to my app.

Microsoft, OTOH, needed me to fill out all the required custom fields, so it sent me to the custom attribute page.

I had mistakenly assumed authentication always took me to the custom attribute page, but that's not the case.