Templates Plugins Courses

Calendar From Google + Offline auth issue

Hi there @alexander @zeroqode,

I’m having a similar issue to @paulogustavopeixoto back in October 2020. I bought the Calendar Google offline plugin and followed the steps from the demo project and documentation. I had it working last night nicely with my three test users, all able to authenticate with Google and then come back in and still see their calendars without a further Login auth from Google.

This morning, I can get the Access Token from the refresh_token but when I elect to Retrieve List of Calendar’s Items it fails.

Error:

Event Button Load Calendar is clicked
*The service Google Calendar Offline - Retrieve List of Calendars just returned an error (HTTP 401). Please contact the plugin author directly for feedback. Raw error: *

*{ “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” } }

Here is my setup, following the documentation and demo project… hopefully someone can spot the issue as I’m banging my head against a wall.

I. Setup Google Developers Console

Step 1 to 4 - Setup Google Developers Console

Step 5 - Copy Client ID and Client Secret, and past it in plugins settings fields, API Key and API Secret.

II. Setting up the Google Playground for Access token action

  1. Select the configuration tab, check the “Use your own OAuth credentials” checkbox and enter the “client ID” and “secret” assigned to a web application on your project
  2. Select the scope Google Calendar API v3 as shown in the image below:
  3. And Google OAuth2 API v2 as shown in the image below:

III. Select the account that you will use to log in to google calendar.
After that, you’ll get the authorization code. Exchange it to ‘refresh’ and ‘access’ tokens using the button action below. Use the Auto-refresh token feature.

Save the refresh token and past it to the field in the Bubble DataBase - User - refresh token

MY APPLICATION FLOW – for testing:

  1. Login the user into Google.

  2. Page reloads: Get Access Token, capture Token variables in State and store idToken.
    a. Have hardcoded the refresh_token for time being during testing.

  1. Then I load up the Calendar items into a DropDown.

**

This is where I get stopped…

**

Error:

Event Button Load Calendar is clicked
The service Google Calendar Offline - Retrieve List of Calendars just returned an error (HTTP 401). Please contact the plugin author directly for feedback. Raw error:

{ “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” } }

I added this – to capture the details but often doesn’t get here:

  1. Lastly, I Load the Events from chosen calendar into a Repeating Grid and Calendar control.

  2. As above… the craziest part, is that this was working last night, flawlessly, and I woke up this morning and it stopped. I could log in as any of my three test users and it just worked, didn’t even need to do the Login process each time, the page load would automatically recognize each user and load their specific calendar?!?

Anyway, any help would be greatly appreciated as I’ve hit a wall for things to try.

Hi @billjreid,

Thanks for reaching out. Unfortunately, it is hard to tell what the problem might be, so it would be best to add our [email protected] account to your Settings -> Collaboration list (ignore the message regarding app plan, as we are an agency and you can easily add us).

Tell us your app name and page name where it occurs on test, as well as exact steps to reproduce. Granting admin rights to your app will speed the investigation process.

We’ll check on it and get back to you asap!

Best,
Alex

1 Like

Hi Alex,

Sounds good, thanks.
I’ve invited you on the Collaboration list and made you an Admin.

App name: Sounding-board
Page name: test-google
Steps:

  1. Load test-google
  2. Hit Login button
  3. Hit Load Calendar button
  4. The dropdown “Choose Calendar” should then have values in it.
  5. If/When that works, Hit Load Events to fill up the Calendar and Repeating Group below.

Thanks again for your help,
Bill.

1 Like

Hi @billjreid,

Thanks a lot for providing the details! Please let us investigate and get back to you asap!

Best,
Alex

Hi @billjreid,

We have investigated your app, and there is no trouble on our side to retrieve the calendars on your testing page:

It is successfully getting the calendars.

Best,
Alex

Ok, thanks for your effort there.

I ended up using www.pathfix.com to do it, so no worries.

1 Like