Hi @Rian
As you provide client-credentials flow parameters, I understand that you are passing valid token endpoint and parameter values. Could you confirm whether you have completed all the steps listed below to register applications?
1.Register App2 and expose the scopes by setting the application id URI.
- Update manifest to define app roles.
{
"allowedMemberTypes": [
"Application"
],
"description": "B2CRole",
"displayName": "B2CRole",
"id": "1fb805ae-3118-4e7c-b5e0-032c289eaf44",
"isEnabled": true,
"lang": null,
"origin": "Application",
"value": "B2CRole"
},
{
"allowedMemberTypes": [
"Application"
],
"description": "B2C",
"displayName": "B2C",
"id": "7316bf0a-f704-4bd4-9d9d-baf2d6f7719e",
"isEnabled": true,
"lang": null,
"origin": "Application",
"value": "B2C"
}],
3.Register the new one (app1) and update the app's accessTokenAcceptedVersion is set to 2.
4.Create a client secret for app1
5.Grant the app(app1) permission for API (app2).
App1 -> API permission -> Add a permission -> select App2 with client id -> Select Application permission ->Select Add permissions.
Then Grant admin consent for those permissions.
5.Request the access token. The actual POST request looks like below:
Replace tenant name and policy.
Make sure to pass correct scope. e.g. https://<tenantName>.onmicrosoft.com/api/.default
POST
https://<tenant-name>.b2clogin.com/<tenantname>.onmicrosoft.com/<policy>/oauth2/v2.0/token
grant_type=client_credentials
&client_id= Replace App1 client_id
&client_secret= App1 client secret
&scope=
Hope this helps. Do let us know if you any further queries.
Thanks,
Navya.