Google People API Error 401 unauthenticated

Hello Bubblers,

Used API connector to build following to retrieve user contacts upon consent. Set up app id and secret in google dev console(removed in the screenshot below for security reasons), however the API call returns 401 error saying missing authentication. Unable to sort this for last 2 days, any help would be great.



Did you initialize the authentication first using Signup/login to social network WF in dev mode?
Actually, the message say you didn’t tested it in run mode. So you will not be able to initialize API call until this have been done.

Yes, i did use signup/login with the social network in WF in dev mode. Tried to publish the app live & then initialize the call, same error 401 :frowning:

When you say didn’t test it in run mode, i am assuming deploying the app live & then initializing the call. Is this correct or am i missing something?

No!
If you look at your screenshot, first one, there’s a warning. If this warning if visible, you need to do (or redo) the signup process using a button on a page with Login with social network action on it. All in dev version and in debug mode (this is automatically set if you click on preview). Once it will be done correctly, this warning will disappear and you will be able to intialize call. Take note tht Bubble will not refresh the token for the editor. If the token expire, you will need to redo the login button process in dev version.

Tried using signup/login with social network & now it takes to 0auth2 screen for user consent which works like a charm, but at the end it now throws this error

In the scopes, do you have the scopes for user info?

this is what i have

In Bubble scopes field?

Nope

Should i add that with a blank space after https://www.googleapis.com/auth/contacts

if I remember, it’s a blank space between scopes for Google yes

Also, I think the correct endpoint for userinfo is
https://www.googleapis.com/oauth2/v2/userinfo

Added profile scope, but still the same error

Should i also add scope for userinfo/email?

Tried adding both scopes, doesn’t work :frowning:

Tried changing endpoint , same error

https://www.googleapis.com/auth/userinfo.profile is the correct scope but you can also add https://www.googleapis.com/auth/userinfo.email
IT,s hard to know the exact issue. But check browser console log, sometimes you will ahve more info. Also, be sure the redirect URL is added to your Google Cloud Console.

Redirect URLs are added & working fine i guess.

Let me explore more & will update once solution is found

Thanks for the help

There’s a lot of topic in the forum about the Google auth2. You can check them and probably compare with differents settings (because there’s some endpoint that can change depending of the request). Actually I don’t have mine set anymore so I cannot check from my old tests :confused:

Will do

Hi @robbin,
I make Google api like this just few days ago (but with calendar), and i maybe can help you.
Two things, first is that you need only to read the contacts from google ? or change them to? If you only read better to use “auth/contacts.readonly” scope, this could help you if you want to subbmit your app.

Here is my scopes:
https://www.googleapis.com/auth/contacts.readonly profile email

and here is SS from my api conector:

I think i have diferent token endpoint to.

Second thing is that i use
Use a generic redirect URL (https://app.umawiasz.pl/api/1.1/oauth_redirect) (checked)
and you must ofc add this URL to google cloud console in Redirect URLs

and results:
image

Hope this can help you!

1 Like