Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403: {"detail": "Invalid issuer"} #10

Open
jessicalundin opened this issue Dec 13, 2023 · 2 comments
Open

403: {"detail": "Invalid issuer"} #10

jessicalundin opened this issue Dec 13, 2023 · 2 comments

Comments

@jessicalundin
Copy link

jessicalundin commented Dec 13, 2023

Hi I'm new to Auth0 and authentication. I worked through the tutorial[https://auth0.com/blog/build-and-secure-fastapi-server-with-auth0/] and keep getting a 403 error: {"detail":"Invalid issuer"}% when I use the command:

curl -X 'GET' \
  'http://127.0.0.1:8000/api/private' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <token>

I can run the sample commands within Auth0 to get the access token, so clearly this piece is working.

curl --request POST \
  --url https://dev-1mpoitrd3j6qadab.us.auth0.com/oauth/token \
  --header 'content-type: application/json' \
  --data '{"client_id":"<client_id>","client_secret":"<secret>","audience":"https://fastapiexample.com","grant_type":"client_credentials"}'

the .env file:

AUTH0_DOMAIN = XXX.auth0.com
AUTH0_API_AUDIENCE = https://fastapiexample.com
AUTH0_ISSUER = https://XXX.auth0.com
AUTH0_ALGORITHMS = RS256

Current thought is the JWT token is not working.

@jessicalundin
Copy link
Author

Looks like one must have an enterprise account to have JWT tokens. Default is client secret.

@IanJempson
Copy link

@jessicalundin I had the same issue, but found the problem was my .env file.
change
AUTH0_ISSUER = https://XXX.auth0.com
to
AUTH0_ISSUER = https://XXX.auth0.com/
and it should work. At least that's where I found I was going wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants