# Sign-in using google

**URL:** <https://forum.bubble.io/t/sign-in-using-google/488>\
**Category:** Need help\
**Created:** [October 29, 2015, 8:42am UTC](https://forum.bubble.io/t/sign-in-using-google/488 "2015-10-29T08:42:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaurav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gaurav/32/6666_2.png) [@gaurav](https://forum.bubble.io/u/gaurav)\
**Post date:** [October 29, 2015, 8:42am UTC](https://forum.bubble.io/t/sign-in-using-google/488/1 "2015-10-29T08:42:25Z")

</div>

Could someone share a working example of sign-in using Google ?  
I am getting a Redirect URI mismatch error after following the instructions here:  
[https://developers.google.com/identity/sign-in/web/devconsole-project](https://developers.google.com/identity/sign-in/web/devconsole-project)

When I put in the exact webpage address (i.e. bubble.is/site/xyz/…) in redirect URI field instead of leaving it blank, the login works smoothly.  
However, I am unable to get the user to sign in whenever the origin page has any URL parameters (i.e. bubble.is/site/xyz/…?tag=abc). It appears google signin needs exact address (from which the login was initiated) in redirect URI field

Any solution for this ?

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [October 29, 2015, 5:10pm UTC](https://forum.bubble.io/t/sign-in-using-google/488/2 "2015-10-29T17:10:32Z")

</div>

Not really, Google is very strict with that, so you should find a way not to have to pass some info with the URL.

---

<div class="post-metadata">

**Author:** ![Blackbeard](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@Blackbeard](https://forum.bubble.io/u/Blackbeard)\
**Post date:** [January 8, 2016, 7:04pm UTC](https://forum.bubble.io/t/sign-in-using-google/488/3 "2016-01-08T19:04:23Z")

</div>

I’m having this same problem.  
I’ve enabled the Google Plugin, and entered both my App Secret and App ID/API Key from the Google Developer Console API Credentials page.

![](https://us1.discourse-cdn.com/bubble/original/1X/9f94450998e732220c18d160b0a75177c8529056.png)

I’ve tried authenticating two ways:

1. Creating a button, whose workflow is set to Sign In using the Google Oauth provider

![](https://us1.discourse-cdn.com/bubble/original/1X/d7c8bcae5b16e349c80481b50b8e9fdd0875c0c2.png)

But, on-click of the button, I get this:

![](https://us1.discourse-cdn.com/bubble/original/1X/3bcdcd8c9b4a21b1703ee5e121d7c854569df9fe.png)

1. I’ve also created a HTML element, with Google-provided code, from [here](https://developers.google.com/identity/sign-in/web/)

On a mobile browser (iOS Safari), the return is “Logged In”, but on desktop, it just opens the auth window, then closes it.

Here’s my example site. The Google-provided login button is at the top, on the left, and the one that uses Bubble.is oauth workflow is on the right (“Sign In”)

[https://bubble.io/site/gmcwsa16auc/version-test/index?debug\_mode=true](https://bubble.io/site/gmcwsa16auc/version-test/index?debug_mode=true)

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [January 9, 2016, 10:56am UTC](https://forum.bubble.io/t/sign-in-using-google/488/4 "2016-01-09T10:56:01Z")

</div>

Please make sure the URLs match EXACTLY, as Google is very strict on this. Meaning, for instance, that in debug mode, since it’s in the URL, you should register this one as well with Google. Since you can have as many as you want it’s not an issue.

The best is to copy paste the URLs when an error is happening.

---

<div class="post-metadata">

**Author:** ![Blackbeard](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@Blackbeard](https://forum.bubble.io/u/Blackbeard)\
**Post date:** [January 9, 2016, 8:02pm UTC](https://forum.bubble.io/t/sign-in-using-google/488/5 "2016-01-09T20:02:38Z")

</div>

Thanks for the reply @emmanuel.

I’ve regenerated the app secret, and the issue still persists (with both Sign-in buttons). I’ve tried to put the full web app URI in to Google oauth, but this is the message google gives:

![](https://us1.discourse-cdn.com/bubble/original/1X/9b4a88e516af6b4a2bf4319408f0da44e8e106eb.png)

Can someone give a screenshot of a working Google Sign in oauth config, and Bubble.is button code?

Thanks,

Rob

---

<div class="post-metadata">

**Author:** ![Blackbeard](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@Blackbeard](https://forum.bubble.io/u/Blackbeard)\
**Post date:** [January 9, 2016, 8:49pm UTC](https://forum.bubble.io/t/sign-in-using-google/488/6 "2016-01-09T20:49:14Z")

</div>

UPDATE/RESOLVED: Adding the Authorized redirect URI of my app now results in successful authorization, via the Bubble.is Google Sign in API:

![](https://us1.discourse-cdn.com/bubble/original/1X/9ca2f6a53bce1ce8998584ad506b6dc911aeb14a.png)

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [January 11, 2016, 4:43am UTC](https://forum.bubble.io/t/sign-in-using-google/488/7 "2016-01-11T04:43:37Z")

</div>

Yes, it has to be EXACTLY the same URL.

---

<div class="post-metadata">

**Author:** ![nicolaschanton](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nicolaschanton/32/1216_2.png) [@nicolaschanton](https://forum.bubble.io/u/nicolaschanton)\
**Post date:** [March 31, 2016, 4:25pm UTC](https://forum.bubble.io/t/sign-in-using-google/488/8 "2016-03-31T16:25:04Z")

</div>

@emmanuel how would you do for pages that have types and consequently id within their url? Thanks.

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [March 31, 2016, 4:46pm UTC](https://forum.bubble.io/t/sign-in-using-google/488/9 "2016-03-31T16:46:26Z")

</div>

I think google won’t let you do this.

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.bubble.io/u/Pat)\
**Post date:** [September 21, 2016, 8:07am UTC](https://forum.bubble.io/t/sign-in-using-google/488/10 "2016-09-21T08:07:56Z")

</div>

what about for example profile pages where the users username is part of the url (as a path or parameter)?  
Lets say I am looking at somebodys profil page (“[www.mydomain.com/profiles/Joe](http://www.mydomain.com/profiles/Joe)”) and decide to login with my google account.

What would be a good way to workaround this problem? My only (not so good) ideas was to have the login button as a redirect to the index whenever someody hits Login on a profile page.

---

<div class="post-metadata">

**Author:** ![david](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/david/32/1942_2.png) [@david](https://forum.bubble.io/u/david)\
**Post date:** [November 21, 2016, 6:44pm UTC](https://forum.bubble.io/t/sign-in-using-google/488/11 "2016-11-21T18:44:36Z")

</div>

Hey @pat did you ever figure out how to solve this? I’m trying to do the same thing and can’t find a good way to do it other than having Google open up the OAuth as a new window. This seems complex technologically.

> <https://stackoverflow.com/questions/7947038/how-to-authenticate-with-google-via-oauth-2-0-in-a-popup>

---

<div class="post-metadata">

**Author:** ![florent.bocquelet](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/florent.bocquelet/32/11409_2.png) [@florent.bocquelet](https://forum.bubble.io/u/florent.bocquelet)\
**Post date:** [May 10, 2017, 10:38am UTC](https://forum.bubble.io/t/sign-in-using-google/488/12 "2017-05-10T10:38:31Z")

</div>

Did you manage to solve this?

Edit: for now a workarround seems to have a page just for signin/signup, and to register its url in the google api console.  
In this page, you can set a workflow that when the page is loaded, signup/login the user with google.

Then, if you want to login from a popup, you add a link element that open this page in a new tab.

The only thing I am missing is to find a way to close this tab once the user is logged in.  
Is there any way to close an opened tab?

Edit 2: to close the opened tab once the user is logged in, just add an html element with a custom state “content” as text. Then in the html element, set the content to   
Finally in the workflow, run a workflow when the user is logged in that change the html content to “window.close();”

Now I am able to login/signup to Google+ from any page of my website and without leaving it 🙂

---

<div class="post-metadata">

**Author:** ![GammaMat](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gammamat/32/177357_2.png) [@GammaMat](https://forum.bubble.io/u/GammaMat)\
**Post date:** [December 19, 2017, 3:35pm UTC](https://forum.bubble.io/t/sign-in-using-google/488/13 "2017-12-19T15:35:46Z")

</div>

Been stuck on this too. After much trial and error, it worked this way for me:

![52](https://us1.discourse-cdn.com/bubble/original/3X/9/8/98e8d8966d698ccb48d0529c707aba1b1b81851d.png)  
Some may be useless, but it works 🙂  
They key was to add \_[https://appname.bubbleapps.io/version-test\_](https://appname.bubbleapps.io/version-test_) in the Authorized redirect URIs for me.  
No need to create intermediary pages, workflows or else.

Hope this can help others!

---

<div class="post-metadata">

**Author:** ![rushabh](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rushabh/32/14144_2.png) [@rushabh](https://forum.bubble.io/u/rushabh)\
**Post date:** [January 17, 2018, 12:12am UTC](https://forum.bubble.io/t/sign-in-using-google/488/14 "2018-01-17T00:12:53Z")

</div>

This is a huge pain. And Facebook is going to disallow dynamic redirect URIs in ~60 days. So Facebook login will become equally painful.

I’ve created a feature request for this: [Issues with redirect URI - Google and Facebook login](http://forum.bubble.io/t/issues-with-redirect-uri-google-and-facebook-login/23156) – please upvote if this will help you.

---

<div class="post-metadata">

**Author:** ![arto.eg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/arto.eg/32/26559_2.png) [@arto.eg](https://forum.bubble.io/u/arto.eg)\
**Post date:** [July 28, 2018, 7:24am UTC](https://forum.bubble.io/t/sign-in-using-google/488/15 "2018-07-28T07:24:07Z")

</div>

Guys, I can sign in using Google, but I am not sure how to fill in the User database with the gmail address I have just signed in with. When I sign in, the email text-group / field is not changed. Only the user UID is changed…

---

<div class="post-metadata">

**Author:** ![arto.eg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/arto.eg/32/26559_2.png) [@arto.eg](https://forum.bubble.io/u/arto.eg)\
**Post date:** [July 28, 2018, 7:36am UTC](https://forum.bubble.io/t/sign-in-using-google/488/16 "2018-07-28T07:36:39Z")

</div>

Ok, solved 🙂 I was using Gmail Auth as opposed to Google Auth. Gmail Auth plugin is used for email sending authentication, not for signing up/logging in. Take care guys 🙂

---

<div class="post-metadata">

**Author:** ![faisalkarimstubapp](https://avatars.discourse-cdn.com/v4/letter/f/43a26b/32.png) [@faisalkarimstubapp](https://forum.bubble.io/u/faisalkarimstubapp)\
**Post date:** [November 28, 2019, 3:28pm UTC](https://forum.bubble.io/t/sign-in-using-google/488/17 "2019-11-28T15:28:05Z")

</div>

Thank you mate. I have tried your workaround, it worked well. I just added another [https://www.appname.bubbleapps.io](https://www.appname.bubbleapps.io), and I can login from Google.

---

<div class="post-metadata">

**Author:** ![nicholasrbarrow](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nicholasrbarrow/32/157879_2.png) [@nicholasrbarrow](https://forum.bubble.io/u/nicholasrbarrow)\
**Post date:** [September 18, 2020, 1:50am UTC](https://forum.bubble.io/t/sign-in-using-google/488/18 "2020-09-18T01:50:12Z")

</div>

If this helps anyone (I stumbled across looking for help) this was my work around:  
I’m dealing with companies that users are assigned to. So I have a data type “Company” that is stand-alone, and a place-holder for each user called “Assigned Company” that the stand-alone Company data-type links to.  
When a user clicks “Login with X” on my site, it redirects them to a page with no data type. Then, for a workflow, I added a “When Page Loads” that triggers the login service. After they’re logged in, I have the workflow redirect them to the “Assigned Company” landing page.  
If anyone needs more help feel free to reach out to me!

---

<div class="post-metadata">

**Author:** ![michael18](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@michael18](https://forum.bubble.io/u/michael18)\
**Post date:** [September 20, 2022, 3:03pm UTC](https://forum.bubble.io/t/sign-in-using-google/488/19 "2022-09-20T15:03:45Z")

</div>

Does this plugin work with Users who already exist in the Bubble database? I have a User [foo@bar.com](mailto:foo@bar.com), and we’re able to get through the Google OAuth flow, but then the general Bubble alert `This email is already in use: foo@bar.com` pops up.

For reference, it works perfectly if the User didn’t exist already, as well as on subsequent attempts.

---

<div class="post-metadata">

**Author:** ![pratima.dudhewar](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@pratima.dudhewar](https://forum.bubble.io/u/pratima.dudhewar)\
**Post date:** [October 11, 2022, 4:18am UTC](https://forum.bubble.io/t/sign-in-using-google/488/20 "2022-10-11T04:18:31Z")

</div>

@emmanuel  
I’m struglling with this from soo long. But i haven’t figured it out yet.  
I want the simplest way to get the idtoken from google.

 ![googleplugin_bubbleio](https://us1.discourse-cdn.com/bubble/original/3X/7/0/70f618011c15282847880b57833dc513f885c9b7.png)

Is it possible to get the idtoken in return with this plugin?

 ![oauth4](https://us1.discourse-cdn.com/bubble/original/3X/7/5/7541968165e10af9b9c2b2d0fe18d828661ef0ca.png)
