Connecting Auth0 to Azure AD B2C via the Auth0 custom identity provider

Rory Braybrook
The new control plane
3 min readAug 12, 2019

This is the direct opposite of a previous post:

Connecting Azure AD B2C to Auth0 via the B2C custom identity provider

Auth0 now also have a custom OpenID Connect provider.

This is an Enterprise connection.

In B2C, create a new application:

In Auth0 under Connections / Enterprise open a new OpenID Connect connection.

and then create a new one by clicking the “+” button to the right.

The “Issuer URL needs to be the “.well-known” discovery endpoint of the B2C policy you will use and have configured e.g.

https://tenant.b2clogin.com/tenant.onmicrosoft.com/v2.0/.well-known/openid-configuration?p=B2C_1_SignUpSignInV2

The “Client ID” is the B2C “Application ID”.

You need to copy the “Callback URL” into the B2C “Reply URL”.

In Auth0, now click the “Try” button for the enterprise connection.

You see the B2C login screen:

Login as a B2C user.

Success:

And you’ll see B2C returns the following JWT:

You may get the Auth0 error:

Googling for “Authorization Extension: Invalid API Key” came up with a solution.

Click the “Extensions” menu item and then enable the “Auth0 Authorization” extension.

Then click “Configuration” and then “Publish Rule”. It will now work — no idea why?

All good!

--

--

Rory Braybrook
The new control plane

NZ Microsoft Identity dude and MVP. Azure AD/B2C/ADFS/Auth0/identityserver. StackOverflow: https://bit.ly/2XU4yvJ Presentations: http://bit.ly/334ZPt5