I have a Node.js/Express Azure web app which authenticates with Azure AD B2C.
Users from the following tenants can currently sign in without a problem:
- Users from the Azure AD B2C tenant
- Users from the 'home' Azure AD tenant that was used to create the Azure AD B2C tenant
I enabled login for 'home' tenant users by adding the 'home' tenant as an Identity Provider.
The steps for doing this are documented here:
Essentially, I was able to add the 'home' tenant as an identity provider by going to:
Azure Portal > Azure AD B2C Tenant > Azure AD B2C > Identity Providers > + New OpenID Connect provider > [ fill in required fields and click 'Save' ]
Then I went to the relevant 'user flow' at:
Azure Portal > Azure AD B2C Tenant > Azure AD B2C > User flows > B2C_1_signin1 > Identity providers > [ check the recently added OpenID connect provider ] > [ click 'Save' ]
I am now attempting to add another Azure AD tenant as an identity provider (using the same steps as above).
In this case it is a tenant associated with the Microsoft Developer Program:
https://developer.microsoft.com/en-us/microsoft-365/dev-program
The following behaviour is occurring (step 5 is where the problem occurs):
- Go to the web app URL
- Get redirected to user sign in page
- Click on the 'Single Sign In' button for the developer tenant
- Select my developer tenant email account
- Then the page gets 'stuck' loading this URL (the page title just says 'Working...':
https://login.microsoftonline.com/<Microsoft-Developer-Program-Tenant-ID-Here>/reprocess?ctx=********
If I select the 'home' tenant for single-sign-on, rather than the developer program tenant, it quickly redirects from the above URL to the MFA authentication prompt page:
https://<my-azure-b2c-tenant>.b2clogin.com/<my-azure-b2c-tenant>.onmicrosoft.com/oauth2/authresp
But this is not happening when I select the developer program tenant.
The only difference I can see between the 'home' Azure AD tenant and the 'developer program' Azure AD tenant is that, well, the latter is associated with a developer program account.
Is that problematic?
Are 'Microsoft Developer Program' tenants able to be added as Identity Providers in Azure AD B2C?
If they are, any ideas what else needs to be done to get this login working?
PS
I just noticed the login eventually times out with this message on the page:
504.0 GatewayTimeout
And this URL:
https://<my-app-name>.azurewebsites.net/redirect?error=server_error&error_description=*******%3a+User+does+not+exist.+Please+sign+up+before+you+can+sign+in.%0d%0aCorrelation+ID%3*******Timestamp%3a+2023-02-11+08%3a41%3a44Z%0d%0a&state=login