2

Referred the following stack overflow post Azure B2C client credentials grant

We are presently using Azure B2C. I understand that Azure B2C does not support the client credential flow for now.

We have a requirement where an external application (server Application outside our organization) needs to access our resource (api hosted within our organization)

Is there any way we can do this from Azure AD-B2C or would we need Azure AD-B2B for these type of requirements. ?

srini
  • 143
  • 1
  • 10

2 Answers2

2

Currently, your specific scenario -- where you are needing an access token to be issued for access by a daemon or server app to your API app -- isn't supported, however you can register the API app through the “App Registrations” blade of the Azure AD directory for your Azure AD B2C tenant.

You can upvote support for the client credentials flow by Azure AD B2C at:

https://feedback.azure.com/forums/169401-azure-active-directory/suggestions/18529918-aadb2c-support-oauth-2-0-client-credential-flow

If the API app is to receive tokens from both a web/native app as well as the daemon/server app, then you will have to configure the API app to validate tokens from two token issuers: one being Azure AD B2C and other being the Azure AD directory for your Azure AD B2C tenant.

Chris Padgett
  • 14,186
  • 1
  • 15
  • 28
  • hi, @Chris, i have tried to setup my api to accept both AD and b2c... but its not working, could you be so nice and give me a hint or an example? --- `public void ConfigureServices(IServiceCollection services) { services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddMicrosoftIdentityWebApi(Configuration.GetSection("AzureAdB2C")); services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddMicrosoftIdentityWebApi(Configuration.GetSection("AzureAd"));` – emamones Apr 22 '22 at 08:26
0

You should not do this anyway. Instead, provide a portal for your customers where they can manage api keys. Implement api keys as a second auth schema in your Api

Michael
  • 81
  • 1
  • 3