Hello everyone,
I am trying to have a flask webapp authenticate users and then have that app talk to a separate flask api. Below are links to both the flask web app and flask api (both are auth0 tutorial repos btw):
Flask WebApp
-
Auth0 Tutorial: Auth0 Python SDK Quickstarts: Login
-
Github Repo: auth0-python-web-app/01-Login at master · auth0-samples/auth0-python-web-app · GitHub
Flask Api
-
Auth0 Tutorial: Auth0 Python API SDK Quickstarts: Authorization
-
Github Repo: auth0-python-api-samples/00-Starter-Seed at master · auth0-samples/auth0-python-api-samples · GitHub
When I try to make a call inside the flask webapp to talk to the flask api I get the following error:
{
"code": "invalid_claims",
"description": "incorrect claims,please check the audience and issuer"
}
What exactly am I doing wrong here? For reference here is the code I’ve used to make the call from webapp to api:
import http.client
conn = http.client.HTTPConnection("localhost:3010")
headers = { 'authorization': "Bearer MY_ACCESS_TOKEN_FROM_WEBAPP_USER" }
conn.request("GET", "/api/private", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))