When I try to get a token with a scope inside it then I get a This application does not have sufficient permissions against this web resource to perform the operation
error.
Failing call:
https://xx.b2clogin.com/xx.onmicrosoft.com/oauth2/v2.0/authorize?p=somepolicy&client_id=xx-xx&redirect_uri=https://localhost:7223/&scope=https://xx.onmicrosoft.com/xx-xx/Some.Scope&response_type=token
I can call it with the openid
scope but then there are no scopes in the token. As I understand you need to set the response_type=token
and scope
to the actual scope of your api.
Working call but no scopes
https://xx.b2clogin.com/xx.onmicrosoft.com/oauth2/v2.0/authorize?p=somepolicy&client_id=xx-xx&redirect_uri=https://localhost:7223/&scope=openid&response_type=id_token
I've alreay added the API to the permissions of the client and granted admin consent so that can't be the issue.
What am I doing wrong here? Or is it maybe not possible to use scopes with a B2C token?