Services Plugins FAQs

The service Google Calendar Offline just returned an error (HTTP 401)

I was able to use the Google Calendar Offline OAuth to sign in and create a test event in the calendar a few times. Then I began getting this error.


I checked my Console, and all the required URIs were there:
image
I checked the plugin, saw that there’d been an update, and there were now two new fields:

I put the same App ID and App Secret into the Get Access Token fields but it didn’t work.
I checked if the documentation had been updated to reveal where the Get Access Token parameters were supposed to be found, and there was a lot of new stuff regarding Google Playground.
I followed the instructions, I added Google Playground to my app URIs, and edited the settings to use my own OAuth credentials, selected the scopes, and got the refresh tokens:
image
and made new workflows:
image
and custom states:

None of it mattered. When I tried connecting to Google Calendar again, after refreshing, I got the same error:

Please help.

Hi @kefa.kabanga,

Thanks for reaching out. Please let us investigate and get back to you asap!

Best,
Alex

Thanks Alex,

It seems to me to be a bug.

If a user is already logged in using Bubble’s native log in system, the Google Calendar connection does not succeed. Only if the user is not logged in, and uses the Google Calendar plugin process to log in, does the connection succeed. This is true for both the free plugin, and the paid plugin. All the documentation and use cases assume that the user will log in only with the Google Calendar signup method, but there is no mechanism for connecting to Google Calendar if a user has already logged in using another method.

These videos, first with the free Google Calendar app, and second with the paid Google Calendar + Offline app, demonstrate the bug with the plugin, where one must first log in using Google Calendar rather than via the native Bubble login system for the plugins to work.

Thanks @kefa.kabanga for feedback!

Unfortunately, it is not a plugin bug.

This is correct. You see, the Google auth plugins actually allow you not only to authorize to your Google account in order to see your calendars, but this process involves logging in with your account which actually logs you in with Bubble. It is using Bubble’s native Sign in with a social network action, and this plugin is indicated as oauth provider.

So if you want to be able to use plugin at its fullest, you just sign up with the social network and select the plugin as provider, and your Bubble user is going to be logged in and see the calendar details.

You can still have your standard signup/login workflow, but in this case it is not possible to see your Google Calendar information.

Hope it helps!

Thanks Alex,

I appreciate your explanation, but it doesn’t actually help me progress. The process I’d like is rather simple:

  1. Users log in to the app via Bubble or any Oauth of their choice
  2. User connects their Google Calendar to their Bubble Account
  3. User is able to manage their Google Calendar from within their Bubble Account.
  4. User is able to disconnect their Google Calendar and remain logged in to Bubble.

The current process with the plugin is that if the user logs in using Bubble natively, and their Google Calendar is not connected, but the user wants to connect their Google Calendar, the plugin gives an error that there is no Google Calendar authorized before they get the chance to authorize it. So a user who has not authorized their google calendar because they signed in to Bubble natively is unable to do so even if they wanted to. This seems to be because of when the plugin checks if the Google Calendar is authorized, rather than the fact that the authorization needs to happen. The check for authorization can be done after the user has connected, rather than before. Therefore it seems like a plugin issue, rather than a Bubble or Google issue.

Your suggestion cannot function for several reasons:
a) One can’t have different user experiences for different users based on how they signed up into the application. Users who log in via Bubble natively should be able to connect to their Google Calendars just as easily as users who signed up using Google’s (or Google Calendar’s) Oauth.

b) Users should have the discretion when and whether they want to use Google Calendar, rather than being forced to provide access to Google Calendar on the first sign in, before they’ve determined that they need to or should. This would be unacceptable from a user experience perspective, where in order to use the app, which can operate without google calendar access, one i) must give calendar access, must use / have a google account. Users should be able to connect their Google Calendar when they feel it suits them in the usage of the app, not as a default setting for the usage of the app, where Google Calendar is but a value added feature.

c) Users may log in with other social networks other than Google / Google Calendar when not logging in natively through Bubble, such as Linkedin, Facebook, etc. Not enabling users who sign up for use of the app through other methods beyond signing up with Google / Google Calendar to connect their accounts at the moment they need a certain Google service is problematic beyond a) and b).

d) Other Oauth connections do not have this problem: Users who log in via bubble can connect their LinkedIn without signing out / being forced to log out of Bubble. This points to the plugin’s choice of where to authorize the credentials (pre-connection rather than post-connection) as being the issue, rather than Google or Bubble.

e) Users may want to disconnect their Google Calendar connection whilst staying logged in to the Bubble app. This functionality should be possible without revoking access to the app in the users’ Google settings, or being forced to log in and out of Bubble to disconnect their Google account.

The workaround, of logging the user out and initiating the sign in with Google Calendar within the same workflow, is very problematic, in that the user must reauthorize the Google Calendar every time they log in, and doesn’t address point e).

Much of this seems to stem from when the plugin performs the authorization, rather than Google or Bubble sign in issues, but the implications are large, and your suggestion to disable all other ways of logging in to the app other than via Google Calendar is unsatisfactory.

Hi @kefa.kabanga,

Thanks for your feedback. I can understand your request, but this is not possible to accomplish with our plugin, and perhaps with other plugins as well because our Google Calendar one is an oauth provider, meaning you can access your own calendars only if being logged in with your Google account, meaning you are logged into your Bubble app as well.

If you “disconnect” your Google account with oauth plugins, you are logging out from your Bubble as well. You are not simply “connecting” to your Google account but also logging in to your Bubble and are able to use its native Current User’s email, for example, and see your gmail.

I hope you understand. :pray:

Hi @alexandru,

Just to confirm,
a) The Google Calendar plugins is useful only if Google Calendar Offline is the exclusive OAuth provider of the whole Bubble application, and there’s no solution that expands its flexibility to accommodate other ways to sign in to Bubble.
b) There is no reliable workaround that does not involve having to log out of Bubble in order to initiate the log in using the Google Calendar plugin.
c) There is no way to make it so that the user doesn’t have to reauthenticate the app every single time they log in using Google Calendar i) if the had initially logged in using another authentication method, ii) if they had logged in initially using Google Calendar and logged out again.

If the above is true, these limitations should be explicit on the plugin page as they are major limitations.

Hi @kefa.kabanga,

Thanks for feedback. So with our plugin or any other OAuth provider plugin you will be able to access its features only by signing up/logging in with this plugin as provider.

We do not include this information because it is actually not a plugin limitation, unfortunately. This is how, in this case, Google works - you are able to access your own Google Calendar data only by signing up with your own Google account. Since Bubble offers you the option to sign up with a social network and actually performing it a native signup/login (you are logged in to your Bubble app) - using the standard Sign the user up or Log the user in and after that Sign up with social network will cause conflicts and errors to pop up. Which is why we build demo apps and information that this plugin is an OAuth provider, even in the editor, for example:

But you should be easily able to use the plugin and let your users authorize just once, then refresh the token as with latest plugin update we added the possibility update the token.

Thanks for understanding. :pray:

I have some questions for plugin developers.

  1. In my application we are using a standard log-in workflow: login+password. I need to give users the ability to wire their google accounts to manage their calendars. In our application standard session TTL = 24 hours. What will happen in this case:
  • a user logs in using the standard Bubble authentication workflow (login/email + password)
  • then click Sign In using Google
  • then after 24 hours this user will log in again. Does this user need to Sign In using Google again and every 24 hours? Or it will keep tokens and will be able to manage events in google calendar?
  1. From our documentation: II. Setting up the Google Playground for Access token action - what is the purpose of doing this? Do I need manually store tokens for each user in my system?
  2. What is the difference between free and paid plugins? Ability to manage more event fields only?

btw, for some reason, the link to official documentation throws 404 error on this page Google Calendar + Offline Plugin for Bubble | Plugin for Bubble by Zeroqode

CC @alexandru

Hi @alex369.xsa,
Thank you for bringing this matter to our attention, we have fixed the link to the plugin’s documentation.

Please find it here: Google Calendar plus Offline Plugin

Regarding your questions:

  1. This plugin lets authorized users access the details of their Calendar events, create new events, or delete events. Once user allowed access to their calendars the token will not get expired and will keep renewing automatically.

You can use the Signup/login with a social network and choose the Google Calendar as the OAuth provider, the user will be able to log in with Gmail and display the calendar as you can see on the plugins live demo page.
signup with google

The token will be refreshed automatically if you follow the Setup Guide and enable this checkbox.

This step is needed to get a refresh token from google playground.
After all steps, you’ll get the authorization code. Exchange it to ‘refresh’ and ‘access’ tokens using the button action below. Use the Auto-refresh token feature.

Please save the refresh token and past it to the field in the Bubble DataBase - User - refresh token and use this refresh token whenever you need a valid access token.

If by free plugin you mean Calendar from Google - it’s a lighter version of the payed plugin, having only 2 data calls and 4 actions that you can use, please check this link for more details: Calendar from Google | Plugin for Bubble by Zeroqode

On the other hand, the Google Calendar + Offline Plugin has more actions and data calls that you can use inside your app, please find more details here: Google Calendar plus Offline Plugin

Hope the above will be useful for you. :pray:
In case there will be any other plugin-related questions, please don’t hesitate to contact me, I’ll be glad to help.
Best regards,