Google OAuth Extension "Bad request" workaround

Options
Jswan
Jswan Member
edited August 2023 in ? Templates & Extensions

Hey all!

I've had issues with XANO's Google OAuth extension. I was continually getting "Bad request" for the "continue with google" part of the flow. Specifically in func_1 (google_oauth_getaccesstoken), when requesting an auth token from google after user successfully signs in.

I followed the demo video beat for beat, and it did not work.

The issue I found

The returned data after a user signs in includes a 'code' (nice!), but it does not include a redirect_uri (as the template would suggest). So the POST request to google for a token fails.

Solution

I just hardcoded the redirect uri (baseUrl/oauth/google/continue) in the POST request for that google_oauth_getaccesstoken function.

XANO team, plz correct me here if I'm wrong - just thought I'd bring it up since I was stumped for a while on this and following instructions.

Comments