Hi,
I’m trying to use the Management API to create a set of new permissions, but the request fails. I’m following the example from this page. Here’s the cURL command anyway though:
curl --request PATCH \
--url 'https://{MY_DOMAIN}.auth0.com/api/v2/resource-servers/API_ID' \
--header 'authorization: Bearer MGMT_API_ACCESS_TOKEN' \
--header 'cache-control: no-cache' \
--header 'content-type: application/json' \
--data '{ "scopes": [ { "value": "PERMISSION_NAME", "description": "PERMISSION_DESC" }, { "value": "PERMISSION_NAME", "description": "PERMISSION_DESC" } ] }'
I’ve replaced API_ID
with the target API that I’m trying to add permissions to (AKA not the MGMT API), and I’ve replaced MGMT_API_ACCESS_TOKEN
with the Management API token (not a token from any of the other APIs I have defined). I’m basically just following the instructions from the page.
This is the response JSON:
{"statusCode":401,"error":"Unauthorized","message":"Bad audience: https://{MY_DOMAIN}.auth0.com/api/v2/"}%
Have a somehow botched the setup for my cURL command (using the wrong token or API ID)? I’m not really sure why this fails.
Any insight would be much appreciated!