Auth0 JWT access token returning 401
Hey! I'm trying to authenticate a user using a JWT access token I get from Auth0. The token seems to be valid according to https://jwt.io/, but my XANO API endpoint keeps returning 401 and the following error message:
{"code":"ERROR_CODE_UNAUTHORIZED","message":"Unsupported input"}
Any ideas?
Thanks in advance!
Best Answer
-
Ah. The Auth0 token is not going to work with Xano integrated authentication. You need Auth0 to generate an ID token, and then an endpoint to redeem that for a Xano auth token based on authing the user. Perhaps we could look inside the token on the decoded side of jwt.io to see what info is in there, and what kind it is (ID token, access token, etc)
Answers
-
Can you show the request history and how you have the endpoint set up? (e.g. a screenshot of the endpoint)?
-
Hey Ray,
Here is the information
Let me know what you think, thanks!
-
Thanks!!! I think I get it now. Just to recap,
- mobile app gets an Id token from Auth0
- mobile app sends this Id token to Xano
- an endpoint from Xano decodes the idToken and checks if there is a user with that information within the user table, if it does exist a user => it generates a JWT and sends it back to the mobile app
- from here, the mobile app sends this JWT in each request
-
That all looks right!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback