Hello,
I have started using Auth0 inside of a django application and I followed the quickstart guide here:
I have it all up and running, login works like a dream and everything was fine.
I then moved on to building an API which again has Auth0 authentication. API is written in python fastapi and again you have amazing documentation which I have followed here:
The problem I am running into now, is getting a user who is logged into the django app to hit the API.
I am getting the current error message:
{
"detail": {
"status": "error",
"message": "Audience doesn't match"
}
}
Which is all pretty self explanatory. My Bearer token has the aud
set as the Client ID of my django app. What needs to happen is during sign in I need to be able to update the audience, so I tried the following:
def login(request):
return oauth.auth0.authorize_redirect(
request,
request.build_absolute_uri(reverse("callback")),
audience=settings.AUTH0_AUDIENCE
)
But this does not work.
How do I update the audience inside the django app so I can authenticate inside of the API?
Any help would be greatly appreciated.