Management API Access Tokens dead end

Hi Josaih,

Again, the Client Credentials Flow link does not provide any information or instruction on how to preform a client credentials token request. It does explain the process admirably and I believe I have a good understanding of the process.

I did as you wrote in your last email:

I had set up a matching application and API several days ago in the hope of using them to have my backend API code perform a client credentials token request. The application is authorized in the API. Both the User Management API and the API I registered are authorized in the application.

I took the Client ID and Client Secret from the application I registered.

I took the Identifier (audience) from the API I registered.

I ended up with this set of parameters: {“grant_type”:“client_credentials”,“client_id”:“8uFuGOFAb5punxWJQf2qYF6TXSx5tnUN”,“client_secret”:“fhW0fDAd3nXcDtapuSITHPPDdd-UX9HDXxKwRg-UFzHdQ8vWNGYoorQIEsACb_6-”,“audience”:“https://dev-7cdpp4yt.us.auth0.com/api/v2/”}

I added the header “content-type”, “application/x-www-form-urlencoded”

I sent it as a POST and got back {“error”:“access_denied”,“error_description”:“Unauthorized”}

I have been unable to use any of the C# examples in the documentation because they tell me to use an object called RestClient. See:

var client = new RestClient(“https://dev-7cdpp4yt.us.auth0.com/oauth/token”)

There is one RestClient object in .NET but that is an Azure specific thing. There are other RestClient things out there in NuGet packages but there is no clue in the AuthO documentation as to which RestClient to use the native .NET HTTPclient instead. It works fine for everything else.

I know I am probably using the wrong ID or secret. My code for getting a test token using a manually obtained ID and secret works flawlessly. As far as I can see, I do not know where to get the correct ID and secret to use. Can someone please help me with information on how to obtain an ID and secret that will enable my code to get the token.

Thanks,

Rob

1 Like