Services Plugins FAQs

Goole Calendar plugin Unauthorized error

Hello,

This is a cross-post from the bubble forums as well.

I am trying to create a simple integration between my Bubble app and Google Calendar using the free plugin Calendar from Google by Zeroqode (Calendar from Google Plugin | Bubble). The only functionality I need is the possibility to create Google Calendar events from my app.

I have created a simple test with two buttons: Sign up/Login with Google & Create Calendar.

If I click the Create Calendar Event button without previously having logged in I receive the expected error message:

{
   "error": {
      "code": 401,
      "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
      "errors": [{
         "message": "Invalid Credentials",
         "domain": "global",
         "reason": "authError",
         "location": "Authorization",
         "locationType": "header"
      }],
     "status": "UNAUTHENTICATED"
   }
}

However after login in through the Signup/Login with Google Calendar button, and successfully granting permissions to my app using the OAuth consent screen (I still need it to be verified but it shouldn’t affect, also I cannot get it verified without providing an example authentication flow) I still get the same error message when trying to create a calendar event.

I have enable the Google Calendar API in the cloud console, I successfully created OAuth credentials and I checked on my third-party allowed apps in my personal google account that my app was effectively given access to manipulate Google Calendar. Additionally I have disabled all adblocker software that perhaps could be blocking any cookies or credentials being passed.

The only thing I can think of is the plugin does not properly store the authorization code and/or token later.

Thank you

Hi @websie,

Thanks for reaching out. Unfortunately, this problem is not reproducing on our side. Please try to make sure that you have configured the plugin and your Google Console account with appropriate steps, as per instructions mentioned here. Especially, make sure you place the correct API keys within editor, as well as make sure you have the correct:

(image for illustration purposes)

In case of index page, you don’t need to specify the page name. And when you log in with this plugin as Oauth provide, please use the appropriate email for calendar_id when trying to create an event:

You can use Current User’s email just to make sure you use it once being logged in.

Hope it helps.

Best,
Alex

Hello Alexandru,

The problem got fixed by substituting the hardcoded test email by the Current User’s email indeed. It is weird since both are the same string but now it works.

Thank you

Always welcome @websie!

If you like our plugin so far, could you please rate it by going to Plugins tab within your editor? You can find the plugin by name and give it as many stars as it deserves. The more feedback we get, the more motivated we are to build great plugins!

Thanks