Fail to get access token in Django oauth toolkit client-credentials grant with Postman

816 Views Asked by At

As title says, i have an issue. I have no problem in getting access token via Postman in password grant by providing (username, password, grant_type, client_id, and client_secret). Access token was received successfully.

But, when come to client-credentials grant, when i enter (client_id, client_secret and grant_type) as parameters, what i received was 500 internal server error as diagram show below.

500 internal server error .

Preview info

both client-id and client-secret I am pretty sure it was correct value as i got it from localhost:8000/admin Application.

After done some research, I realise i might miss out a parameter called audience a.k.a API identifier.

What is audience

The audience is a parameter set during authorization, and it contains the unique identifier of the target API. This is how you tell Auth0 for which API to issue an Access Token (in other words, which is the intended audience of this token). If you do not want to access a custom API, then by setting the audience to YOUR_AUTH0_DOMAIN/userinfo, you can use the opaque Access Token to retrieve the user's profile.

I have no idea how to get audience value. So, my question is how i get the audience value of my API server?

Please guide me and many thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

Problem solved. It is unrelated to oauth toolkit, it is my middleware cause error. Thank you.