You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 8, 2019. It is now read-only.
I'm trying to make an authenticated request from the frontend to the backend.
The overall authentication scheme is the following:
frontend makes a direct call to Auth0, authenticates, and gets back an authToken.
frontend makes a request to backend, with Authorization: 'Bearer ${authToken}', and the request should be authenticated.
Repro
frontend makes a call to Auth0 to get authToken, this works and can be done on chronoscio.now.sh, after login, go see the IndexDB storage of the web page (in the console Storage tab), and extract the idToken.
curl -X GET localhost/api/nations/ -H 'Content-Type: application/json' -H 'Authorization: Bearer /* copy paste the id token*/'
note: GET shouldn't require auth on that endpoint, but is simpler to type here. The same behavior appears for POST too.
Expected
200 response
Actual
401 "Incorrect authentication credentials."
I'm pretty sure it has to do with wrong CLIENT_IDs set somewhere, or wrong permissions between apps in Auth0, but can't figure where.
Notes
The app the frontend is connecting to is ChronoScio [DEV].
If I use the django (test) application, and take the access_token given by this api, it works.
I'm pretty sure the idToken given to the frontend by Auth0 is correct: I sometimes see Signature expired, and if I use another token then it just returns another error ("Invalid token").
I'm trying to make an authenticated request from the frontend to the backend.
The overall authentication scheme is the following:
Authorization: 'Bearer ${authToken}', and the request should be authenticated.Repro
idToken.curl -X GET localhost/api/nations/ -H 'Content-Type: application/json' -H 'Authorization: Bearer /* copy paste the id token*/'Expected
200 response
Actual
401 "Incorrect authentication credentials."
I'm pretty sure it has to do with wrong CLIENT_IDs set somewhere, or wrong permissions between apps in Auth0, but can't figure where.
Notes
ChronoScio [DEV].django (test)application, and take theaccess_tokengiven by this api, it works.Signature expired, and if I use another token then it just returns another error ("Invalid token").