How to get 1 consent screen (not two) to login with the Google Plugin and to grant access to specific scopes

Hey, everyone!

Here is the current flow I want to achieve:
-Click on the “Sign in” Google Button.
-Grant consent to the app for specific scopes (Gmail + GCalendar)
-Get redirected to the index page.

Here is the struggle:

  1. I can successfully login with the Google plugin, but I cannot ask for specific scopes and store the (access + refresh) tokens.

  2. I can successfully grant access for the specific scopes but I cannot login at the same time.
    Here is the reference: Google Calendar API use case - #7 by mebeingken

Currently, I’m doing one after the other to have both the user logged in and its tokens stored, but in terms of UX, I have two consent screens. This is not natural at all.

Any expert on Google Oauth2 here? :slight_smile:

Check out my video here: Google Oauth on bubble.io using the api connector - YouTube

I’m able to login and get access to specific scopes using the api connector. feel free to comment on the video if you have any questions. Thanks!

1 Like

Many thanks, Wisebubbler. It is interesting to do it that way.

But I don’t see how you store the refresh token once you log in.

The refresh token is sent just the first time you authorize the app, and then I need to save it.

Do you know how it’s possible to catch the authorization code response?

Hi - That’s because in the video @wisebubbler is using ‘Oauth2 User-Agent Flow’ as the Authentication method, so Bubble ‘automagically’ handles the refresh token/new key part for you.

Whereas in the first set of instructions you followed Google Calendar API use case - #7 by mebeingken @mebeingken is using ‘Non or Self-handled’ so he had to build a workflow (which is detailed in that post) to handle the refresh token part.

I would start by going down the first route as it’s much easier and if you hit issues later on then go down the second route.

1 Like

@wrightj2
For google oauth i’m doing following steps.
Screenshot1:


screenshot2:

screenshot3:

I want the idtoken from google to perform next authentication with our login API.
Can we get accesstoken, idtoken in response from google?
when i run the just googleoauth in app it works properly. but i need the idtoken.

Do i need that extra APIenpoint call to get the token?
Thank you in advance…