Auth0 Home Blog Docs

Incorrect authentication credentials (Django + Auth0 API)

django

#1

Hi, I’m having trouble to access Django API with Auth0 JWT token.

First I got a token from terminal using this command:

curl --request POST --url https://<COMPANY_DOMAIN>/oauth/token --header ‘content-type: application/json’ --data ‘{“client_id”:"<TESTAPP_CLIENT_ID>",“client_secret”:"<TESTAPP_CLIENT_SECRET>",“audience”:"<COMPANY_API>",“grant_type”:“client_credentials”}’

And the token is:

{“access_token”:"",“expires_in”:86400,“token_type”:“Bearer”}

And then I tried to this from terminal:

curl --request GET
–url http://127.0.0.1:8000/location/
–header 'Authorization: Bearer ’

But it always returns this JSON data below:

{“detail”:“Incorrect authentication credentials.”}


#2

(Continued)

I’ve read and followed this tutorial: (https://auth0.com/docs/quickstart/backend/django/01-authorization)

I don’t know what the problem is.
Or am I on a wrong way?
Please guide me, thank you.