Management API returning "Unauthorized" "Missing authentication"

So I added a Custom API to support a custom domain and followed the example commands in the api configuration Test page but its not working as it should. The management api is responding with:

{"statusCode":401,"error":"Unauthorized","message":"Missing authentication"}
  • Step 1 Get an oauth token with a custom domain as the audience:


    curl --request POST \
      --url \
      --header 'content-type: application/json' \
      --data '{"client_id":"CLIENT_ID","client_secret":"CLIENT_SECRET","audience":"https://CUSTOM_DOMAIN/api/v2/","grant_type":"client_credentials"}'


      "access_token": "TOKEN",
      "token_type": "Bearer"
  • Step 2 Send a api request to your custom domain with the token from the response of step 1:


    curl --request GET \
      --url https://CUSTOM_DOMAIN/api/v2/users \
      --header 'authorization: Bearer TOKEN'


    {"statusCode":401,"error":"Unauthorized","message":"Missing authentication"}

Here are my current scopes on the API:

Am I missing a piece of configuration or going about something wrong here? Any help is much appreciated.


After much trial and error I figured out what was going on. My custom domain that was configured through AWS CloudFront did not have the Authorization header whitelisted. So when the request passed through our custom domain the header was being stripped off.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.