# Issues connecting to Google API w/ Oauth2

**URL:** <https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016>\
**Category:** APIs\
**Created:** [May 5, 2020, 3:32pm UTC](https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016 "2020-05-05T15:32:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![contact.aaron.alter](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@contact.aaron.alter](https://forum.bubble.io/u/contact.aaron.alter)\
**Post date:** [May 5, 2020, 3:32pm UTC](https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016/1 "2020-05-05T15:32:31Z")

</div>

Hello,

I’m trying to connect and authenticate with the Google Search Console API through Oauth2 User Agent Flow.

I think I’ve set up everything correctly for the most part but keep getting this error message:

![image](https://us1.discourse-cdn.com/bubble/original/3X/c/d/cda356b43f6081daf9ab798172cd67b3991db53b.png)

And here is my config:

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

I feel like there’s something wrong with the user profile endpoint but I don’t know what else I should use.

Any help would be greatly apprechiated. 🙂

---

<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:** [May 5, 2020, 3:57pm UTC](https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016/2 "2020-05-05T15:57:05Z")

</div>

I don’t think the user profile endpoint you’re using is correct. You need an endpoint that returns the user ID (for other Google APIs, it is [https://www.googleapis.com/oauth2/v1/userinfo?alt=json](https://www.googleapis.com/oauth2/v1/userinfo?alt=json))

---

<div class="post-metadata">

**Author:** ![contact.aaron.alter](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@contact.aaron.alter](https://forum.bubble.io/u/contact.aaron.alter)\
**Post date:** [May 6, 2020, 6:38am UTC](https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016/3 "2020-05-06T06:38:08Z")

</div>

Thanks for responding, found that URL somwhere on the Forum and tried it as well but no luck unfortunately.

It tells me that the API has not been configured properly…

![image](https://us1.discourse-cdn.com/bubble/original/3X/8/5/85154efae662ac55718835c781cf9d7e955ed8e8.png)

---

<div class="post-metadata">

**Author:** ![contact.aaron.alter](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@contact.aaron.alter](https://forum.bubble.io/u/contact.aaron.alter)\
**Post date:** [May 7, 2020, 2:54pm UTC](https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016/4 "2020-05-07T14:54:06Z")

</div>

If anyone has the same issue this solved my problem: [Google Calendar API use case](http://forum.bubble.io/t/google-calendar-api-use-case/20867/7)

---

<div class="post-metadata">

**Author:** ![elliot.beaudoin](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/elliot.beaudoin/32/68118_2.png) [@elliot.beaudoin](https://forum.bubble.io/u/elliot.beaudoin)\
**Post date:** [August 16, 2020, 11:41pm UTC](https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016/5 "2020-08-16T23:41:54Z")

</div>

So, you are basically not using the Login with social out of the box functionality? I was trying to add all of my scopes I need later in my app to the very beginning of the user’s Login / Sign Up flow. This way the refresh token process is in theory taken care of. Was really hoping not to have to manage that.

---

<div class="post-metadata">

**Author:** ![contact.aaron.alter](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@contact.aaron.alter](https://forum.bubble.io/u/contact.aaron.alter)\
**Post date:** [August 17, 2020, 7:32am UTC](https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016/6 "2020-08-17T07:32:54Z")

</div>

Seems like one of the last updates solved this issue (at least it did for me) and I can now use the standard “login with social” functionality (API connector with OAuth2)

---

<div class="post-metadata">

**Author:** ![elliot.beaudoin](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/elliot.beaudoin/32/68118_2.png) [@elliot.beaudoin](https://forum.bubble.io/u/elliot.beaudoin)\
**Post date:** [August 17, 2020, 9:46am UTC](https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016/7 "2020-08-17T09:46:14Z")

</div>

@contact.aaron.alter would you mind sharing your API settings and the workflow? I’m really flying blind without having detailed errors.

---

<div class="post-metadata">

**Author:** ![contact.aaron.alter](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@contact.aaron.alter](https://forum.bubble.io/u/contact.aaron.alter)\
**Post date:** [August 17, 2020, 11:01am UTC](https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016/8 "2020-08-17T11:01:08Z")

</div>

What API are you trying to connect to / whats you’re use case. Maybe I can help you out…

---

<div class="post-metadata">

**Author:** ![elliot.beaudoin](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/elliot.beaudoin/32/68118_2.png) [@elliot.beaudoin](https://forum.bubble.io/u/elliot.beaudoin)\
**Post date:** [August 19, 2020, 2:40am UTC](https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016/9 "2020-08-19T02:40:22Z")

</div>

Sheets / Classroom. I receive the same message for both.

---

<div class="post-metadata">

**Author:** ![contact.aaron.alter](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@contact.aaron.alter](https://forum.bubble.io/u/contact.aaron.alter)\
**Post date:** [August 19, 2020, 7:12am UTC](https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016/10 "2020-08-19T07:12:07Z")

</div>

@elliot.beaudoin No idea how much you know so I’ll just try to do it super basic just to be safe, also in case someone else sees this who might not have any idea.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/f/3/f394ccf34d0c5949c4ce8b1e6ff215a50423f47c.png)

Try the following config:  
For 1) & 2) put in the “Client Secret” and “Client ID’s” from GCP in here.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/a/4/a436008bfb3aa0ddfb5d71c7b39d1c64de1ad1eb.png)  
 → Make sure that in GCP you authorize the correct URL (the one where you’re putting the button that has “login with social” workflow associated with it.)

For 3) use: [https://www.googleapis.com/auth/documents](https://www.googleapis.com/auth/documents) - I’m guessing that’s the one for sheets…

For “login dialog redirect” paste: [Sign in - Google Accounts](https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force)  
For “Access token endpoint” paste: [https://www.googleapis.com/oauth2/v4/token](https://www.googleapis.com/oauth2/v4/token)  
For “User profile endpoint” paste: [https://www.googleapis.com/oauth2/v1/userinfo](https://www.googleapis.com/oauth2/v1/userinfo)

Btw you can also add multiple scopes separated by a [space], so for testing purposes you could just try to use this scope:  
[https://www.googleapis.com/auth/userinfo.profile](https://www.googleapis.com/auth/userinfo.profile) [https://www.googleapis.com/auth/userinfo.email](https://www.googleapis.com/auth/userinfo.email)

And then do the following call to retrieve user info associated with the logged in account:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/4/7/477ebf24f611a237c4b5a61dc7491d91697949d6.png)

Hope this helps  
Also test your calls on [OAuth 2.0 Playground](https://developers.google.com/oauthplayground/) always helped me with the setup.

---

<div class="post-metadata">

**Author:** ![alexandre9](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@alexandre9](https://forum.bubble.io/u/alexandre9)\
**Post date:** [December 22, 2020, 1:22pm UTC](https://forum.bubble.io/t/issues-connecting-to-google-api-w-oauth2/90016/11 "2020-12-22T13:22:52Z")

</div>

hello, Thanks a lot for this.  
I have a message

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/5/b/5bef6a0a7bb6e11eb8a5840838efacea0b3a511b.png)

If I understood correctly It is because I did not ☹

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/6/0/601b41475093162cf4ad77f481f612c474c054f2.png)

unfortunatly I do not know How to do this : “setup a login workflow, run your app in run mode (with debug\_mode=true in the URL) and authenticate with the service. Once done, your access token will be used to initate the API calls and the API will be marked as valid”.

thanks for your Help  
Alex
