Hi there @alexandru @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
- 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
- Select the scope Google Calendar API v3 as shown in the image below:
- 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:
-
Login the user into Google.
-
Page reloads: Get Access Token, capture Token variables in State and store idToken.
a. Have hardcoded the refresh_token for time being during testing.
- 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:
-
Lastly, I Load the Events from chosen calendar into a Repeating Grid and Calendar control.
-
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.