2

When I try to access

https://<myB2cDomain>.b2clogin.com/<myB2cDomain>.onmicrosoft.com/oauth2/v2.0/authorize?p=<my_sign_up_sign_in_policy_name>&client_id=<my_client_id>

I get the following error:

The client id '<my_client_id>' specified in the request is not registered in tenant '<myB2cDomain>.onmicrosoft.com'

I have tried to create new b2c tenant a couple of times and tried to register the app several time, but I always get this error message.

I am following this guide when configure: https://about-azure.com/using-azure-ad-b2c-with-angular-8/

I found a stackoverflow post concerning the same problem, where the answer was to create the b2c application using the portal instead of the app registration portal. I have only used the the portal when configuring this. Azure AD B2C Error: The client Id specified in the request is not registered in tenant

I have configured Azure AD as an identity provider using this documentation: https://learn.microsoft.com/en-us/azure/active-directory-b2c/identity-provider-azure-ad-single-tenant

I cannot spot any errors compared to the guides and is kind of stuck. Maybe someone here can push me in the right direction. This is the first time i try to configure Azure B2C

Tony
  • 1,394
  • 5
  • 22
  • 48

2 Answers2

2

When you log in your b2c tenant, in the home page you will see Azure AD B2C and Azure Active Directory. You should get the client_id of an Azure AD B2C application.

enter image description here

You should create an application under Azure AD B2C->Applications(or App registrations). Only Azure AD B2C directory applications will fall into Applications tab, both Azure AD B2C directory applications and Azure AD directory applications will fall into App registrations(Preview) tab.

enter image description here

Then click User flows->select your user flow->Run user flow->select the application you just created->Run user flow endpoint for a test.

enter image description here

Tony Ju
  • 14,891
  • 3
  • 17
  • 31
  • This is the right answer. For me I needed additional info that was, that my default directory (despite being accessed via B2C was a non B2C directory. I had to create a new tenant and switch to that via the portal. It was a very subtle bit of text that set me right plus this answer. – Dessus Apr 20 '21 at 22:58
  • My screens didn't look the same as this answer until I switched to the correct directory (ie a B2C one). You can switch directories in the top right under your user name drop down area – Dessus Apr 20 '21 at 22:59
1

I kept receiving this error when my user did not have the “Application administrator” role during the creation of the app registration. Adding the role after the fact did not affect the error.

I had to create a new app registration after I was assigned the role, then the error went away.

Without this role, the app registration does not get associated with the tenant's AD instance. It will show up there (in addition to the AD B2C blade), but I just could not run any flows with it.

cdonner
  • 37,019
  • 22
  • 105
  • 153