Home > Net >  Azure AD B2C - Error AADB2C90018 immediately after the app registration was created
Azure AD B2C - Error AADB2C90018 immediately after the app registration was created

Time:12-31

I have a multitenant application and I use Azure B2C as an identity provider. Each tenant has its own application registration (with different redirect URLs). The application registrations are created programmatically at tenant creation.

Immediately after the creation, Azure B2C gets the following error when I redirect an user to the login page:

AADB2C90018: The client id '<just-created-app-id>' specified in the request is not registered in tenant '<my-tenant>'.

After few seconds, the same URL will work as expected. I assume the app registration creation is executed asynchronously by Azure B2C and eventually it is processed.

Question: how can I make sure that I don't redirect the user to Azure B2C before the new app registration is functional?

CodePudding user response:

This is due to replication delay in the AAD directory layer. Delay your subsequent operation which relies on the App Id by a minute (replication typically occurs within 10sec across region). That gives enough time for the application object to replicate into all the DC’s.

https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-architecture#azure-ad-architecture

  • Related