Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple domains for single Azure B2C Application

We have an application that we want to host only once but allow 2 different domains to direct to the one instance then we change the branding based on the incoming host. For instance https://app.abc.com points the same instance as https://app.def.com.

So they are not subdomains but rather independent domains. This would mean they also share the same Azure registered application but different return url's https://app.abc.com/auth/openid/return and https://app.def.com/auth/openid/return.

The Azure portal, however, gives the error

"You may not use more than 1 external domain(s)"

.

Is there any way around this without having to host 2 instances of the same application, each with the own Azure application/client id?

like image 798
chookie Avatar asked Jan 28 '23 09:01

chookie


2 Answers

As Wayne mentioned, it is not currently possible to reply to multiple domains.

However, one workaround is to build a proxy in one of the websites. You always redirect to this proxy, which then redirects to the proper site. You could use the state parameter to store which "site" the user clicked "sign in" from, and then based on that redirect properly. You would have to be careful in making sure the token is passed through securely.

like image 152
Parakh Avatar answered Feb 02 '23 09:02

Parakh


Unfortunately, you cannot achieve this.

Reply URLs must all belong to the same domain. And Redirect URIs must all belong to the same domain .This is a limitation for AAD B2C application Registration.

You can also see this note in Azure portal:

enter image description here

Is there any way around this without having to host 2 instances of the same application, each with the own Azure application/client id?

For Web API or Web App, as I known, there is no way to achieve this for now.

I suggest you can upvote this idea in this Uservoice Page, AAD B2C Team will review it.

Hope this helps!

like image 21
Wayne Yang Avatar answered Feb 02 '23 10:02

Wayne Yang