chookie
chookie

Reputation: 461

Client Credential Gran Type Not Support with a Custom B2C Policy

I am trying to generate an access token from our policy but I am getting this error.

AADB2C90086: The supplied grant_type [client_credentials] is not supported.

This is a sample postman request

POST /{tenant}/oauth2/token?p=B2C_1A_SignUpOrSignInWithAAD HTTP/1.1
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

grant_type=client_credentials&client_id={client_id}&resource=https%3A%2F%2F{app_url}&client_secret={client_secret}

but it works fine if I don't use our custom policy and just go direct to the B2C tenant

POST /{tenant}/oauth2/token?api-version=1.0
... same as above

Is there something missing in our custom policy?

Upvotes: 3

Views: 2066

Answers (1)

spottedmahn
spottedmahn

Reputation: 16011

B2C does not support the Client Credential Flow. Additional details are here. And here Daemons/server-side apps.

but it works fine if I don't use our custom policy

That's because you getting a token from Azure AD, not B2C.

Upvotes: 5

Related Questions