Google Oauth Manually - with multiple scopes

Hi Guys,

Would appreciate some help, i’m pulling my hair out with this one…

Google Oauth Setup Manually without auth plugins…

https://accounts.google.com/o/oauth2/v2/auth?client_id=102525300075-n5q130g3e4nlnffnk1ne7rdreeihprm1.apps.googleusercontent.com&redirect_uri=https://mymarketr-io.bubbleapps.io/version-test/company/&response_type=code&scope=https://www.googleapis.com/auth/webmasters+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/analytics+https://www.googleapis.com/auth/business.manage&access_type=offline

This works, pulling to allow user to ‘login’, as i receive an The Auth Code, and I have backend workflow to collect google refresh token etc.

But it doesn;t actually log the user in to store this data anywhere?
This is button workflow.

Step 2 is schedule backend workflow… to pull data from API.

Backend Workflow looks like this?


APi setup for Access token is:

API setup for GOogle refresh is this:

Userinfo API is this:

I’d really appreciate any guidance that can be provided?

Thanks in advance!

If your goal is to create a new user, use user agent oauth instead of doing everything manually. The manual auth should mostly be used for user already logged in.

Hey,
Why would that be the case?
Oauth2 User-Agent Flow doesn’t allow me to collect Code for Access and refresh tokens?

I want to be able to work with the apis when the users isn’t directly logged in?\

user-agent flow will handle that for you (don’t forget to activate offline_access). Be sure also to trigger backend WF or recurring WF when the user is logged in first.

However, if you need to access API when another user is logged in (for example: you need to display calendar of user A to user B), at this moment you need to use manual process.

Other reasons to use manual process:
A) oauth2 doesn’t return an email or this email is in nested JSON
B) you need to allow single user to access to mutiple API that use oauth2 authorization code (user-agent) flow

If you need to use manual process, you should use Bubble auth first and add API auth info to this user (better to use a related DB… make sure to set privacy rules correctly)

Yes this is possible to create a new user in manual process, but this is a lot more complex because you need to generate a password and use backend WF to keep everything safe…