** I am integrating the Google Calendar API and have configured the credentials correctly. Using Postman and other programming languages, I am able to send requests to my project in the Google Developer Console, pass the OAuth 2.0 protocol, and execute methods like create event and delete event in Google Calendar.
However, I am unable to authenticate in Bubble Plugin API Calls. As shown in the configuration screenshot, I have set everything up correctly. Despite this, I cannot pass the OAuth 2.0 protocol in Bubble. Interestingly, I can authenticate using Authentication: None or Self-handled with the access token I obtained from Postman.
How can I correctly authenticate using OAuth2 User-Agent Flow in Bubble? I suspect that I am encountering issues with the access token.**
Did you “initialize” the auth in debug_mode with “Signup to social network” action? You will not be able to initialize call until this is done. After, you can add API Calls. API Connector doesn’t refresh token but this will be done for users.
So I’m running into a wall with this as well, and have the API connector setup similarly. I get this error once I login to google, select the user, and authorize the scope:
API Connector error: the Oauth2 API Google Calendar is not configured properly - received error from API the service Google Calendar just returned an error (HTTP 401). Please consult their documentation to ensure your call is setup properly. Raw error:
{“error”:
{
“code”: 401,
“message”: “request is missing required authentication credential. Expected oauth2 access token login cookie or other valid authentication credential. See https://developers.google.com/sign-in/web/devconsole-project”
“status”: “unauthenticated”
}}
I celebrated too soon. I made my first event just after with no issue. But, then I came back later to work on more customizations, and I’m getting 401 errors again, despite not having issues with the Oauth process, at least with initiallizing. I have gone back to run the Oauth process again and it goes without a hitch, and the API connector says its correctly setup on the API. But I have remade this call several times just in case but same result each time, despite not having changing the core setup. Perhaps I have a small typo somewhere, but I can’t see it.
Below is the setup for the API call to create the event, and the response I get when initializing it:
The access token you got on the first auth initialization is expired. API connector doesn’t refresh it but it will be refreshed for your user. Do the login to social network again in debug mode and you will be able to edit calls
if you use Bubble user-agent auth process, you don’t need to care about that. Bubble will refresh it when it’s needed.
If you want to validate it, add a GET request to userinfo endpoint (allow workflow to continue if error checkbox enabled but also detect header) and check if you get userinfo or error to validate it.
Google have an endpoint to validate access_token, however, you don’t have access directly to it, so you cannot call this endpoint that require access token in parameter (There’s a way to cheat that however with a backend WF…)