Reputation: 1310
Technical Stack
We have configured B2C with WebApp & WebApi.
We need to have Azure B2C login page when user click on below link
http(s)://mydomain.com/$tenantAlias
So that means, based on tenantID, we need to configure tenant address, client ID for correct login page for signin page.
In single tenant, we set up configure(app) in startup.cs, so in this case, we need to read url in startup.cs file itself and then get the configuration values accordingly.
Now, same way we need to implement in API, so will pass tenant ID in header from MVC, so how to read headers in startup.cs file?
Is this the right way to implement Azure B2C multi tenant?
Upvotes: 0
Views: 540
Reputation: 11315
You can see how I added multiple trusted token issuers in a .Net API here: https://github.com/azure-ad-b2c/apps/blob/master/apps/spa-hellojs/source-code/.Net-Core-API-RBAC/MultiBearerAPI/Startup.cs#L35
In this example i trust tokens from an AAD tenant, and an AAD B2C tenant.
Upvotes: 1