Can't Use/Debug Google OAuth from Xano
Hi! Would love your help solving this pickle. I'm building an app on Wized, and I'm trying to debug the Google OAuth flow directly in Xano so I can see full responses and tokens.
No matter what I do, I can't seem to get a valid response from google (invalid_grand, malformed auth code), see my steps below.
What am I missing? Going nuts after so many hours trying to figure this out.
Thanks!
Step 1: Add Xano to authorized URI and Redirect URI in Google Console
Step 2: Get auth URL in Xano
Step 3: Use the auth URL to get OAuth Code
I paste the auth URL from step 2 in a new tab, and I copy the oauth code from the url parameters
Step 4: Submit oauth token request - INVALID_GRANT
I use the oauth code from step 3 as input, and I am confident that this code hasn't been used yet to get a token (I took no other actions between step 3 and step 4)
(note: I know the code in the screenshot doesn't match, I tried multiple times)
{"request":{"url":"https://oauth2.googleapis.com/token","method":"POST","headers":["POST /token HTTP/2","Host: oauth2.googleapis.com","accept-encoding: gzip, deflate","content-type: application/x-www-form-urlencoded","accept: application/json","content-length: 300"],"params":{"code":"%2F0AZEOvhUH1pPSYleB_ZMu4EW-RcnE6yQdAz3WLIYUkBCreRgkyJ38UTMH_cQimPVYeIJWZg","client_id":"292126823835-m73boh7j58f78lb1rtq316e1o16l4i49.apps.googleusercontent.com","client_secret":"xxxxxx,"redirect_uri":"https://x8ki-letl-twmt.n7.xano.io/","grant_type":"authorization_code"}},"response":{"headers":["HTTP/2 400","pragma: no-cache","cache-control: no-cache, no-store, max-age=0, must-revalidate","expires: Mon, 01 Jan 1990 00:00:00 GMT","date: Mon, 03 Jul 2023 19:56:29 GMT","content-type: application/json; charset=utf-8","vary: Origin","vary: X-Origin","vary: Referer","content-encoding: gzip","server: scaffolding on HTTPServer2","content-length: 88","x-xss-protection: 0","x-frame-options: SAMEORIGIN","x-content-type-options: nosniff"],"result":{"error":"invalid_grant","error_description":"Malformed auth code."},"status":400}}
Comments
-
Solved - I had to decode the Auth URL to get a properly formatted OAUTH code.
tldr copy paste the URL with the oauth code to here and decode https://meyerweb.com/eric/tools/dencoder/ -
Hi @Jeremie! 👋
Thank you for sharing the solution! 🙏 It's super helpful in case other members face the same issue.
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