How to login to Bubble using Google OAuth Extension

Hey everyone, I’ve been working on a Bubble app that allows users to log in via Google OAuth or the traditional username/password method. I’ve also created some browser extensions that integrate with this login system. For username/password login through the extensions, I use Bubble’s “Log the user in” action, obtain a session token, and everything works fine without needing to check the “Ignore privacy rules when running this workflow” option.

However, I’m running into issues with the Google login through the extension. Here’s the process I’m following for OAuth:

To initiate the OAuth flow and obtain the access/refresh token, I’m using:
chrome.identity.launchWebAuthFlow

Once I have the access token, from Bubble I call Google’s User Info API to retrieve the user’s email, check if it exists in my Bubble database, and return that info to the extension.

The problem is, unlike traditional username/password logins, I don’t get a Bubble session token for the Google login process. So, Bubble doesn’t recognize that the user is logged in and I can’t log him in because there’s no password, right?

My questions are:

  • Should I be handling the Google OAuth consent flow directly within Bubble instead, like a User-Agent flow?
  • How can I get Bubble to recognize this Google user and issue a session token after completing the OAuth flow?

Thanks in advance for your help!

1 Like

Hey, bubble veterans @keith @lottemint.md I saw two of your posts where you were included in the OAuth topics. I went through this topic too but that didn’t give me an idea of how I could achieve what I asked in the original post.

Any chance to give me some wind in the back?
Thanks in advance and apologies for ping once again!

Login/signup with a social network is the action you need :slight_smile:

Mm, we might not have understood each other. I need this action to be called from the backend workflows, which allow me to call some other APIs in the bubble and interact with the database.

Login/signup with a social network will only initiate OAuth from the Bubble.
This:

Ah, I see. Sorry, I haven’t done this particular integration before so can’t offer any (useful) contributions.

1 Like

Haven’t implemented OAuth via extension. However, I would recommend handling the Google OAuth consent flow directly within Bubble because Bubble’s authentication is designed to recognize the user sessions when handled within the app.

1 Like