Client Credential Gran Type Not Support with a Custom B2C Policy

安稳与你 提交于 2020-06-13 04:05:02

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/49757722/client-credential-gran-type-not-support-with-a-custom-b2c-policy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!