Hello Folks,
I’m trying to integrate a Google API (Prediction API) using the API Connector and having some difficulty around authentication. The Google API requires OAuth; however, the nature of the API call is not necessarily against personally owned data, and therefore Google allows for both personal accounts, alongside Service accounts, to be used to authenticate.
Per Google’s instructions, I’ve used the Google Cloud Platform console to create an OAuth “Other” (service account) credential type, where Google provides both a Client ID and Client Secret. I’ve also used the Google OAuth Playground to authenticate against the API and test my API calls (everything worked fine). I also used a generated access token in an API call from Apigee (web based API client) to test my calls from there - everything again checked out.
My problem arose when trying to make the call from the Bubble API Connector. When I attempt to Initialize the API Connector, it returns an authentication error. Within the API Connector, I’ve selected the following:
-
Authentication: “OAuth Password Flow”
-
Username:
-
Password:
-
Token Endpoint: https://www.googleapis.com/oauth2/v4/token
I then filled out the rest of the call with a “Post” to the proper API endpoint, header for content-type, JSON body, etc. As I mentioned, the contents of the call should be good as I’ve tested it from two other locations successfully using an already generated access token.
Where is this potentially going wrong? Is the Username / Password section being appropriately used with the Client ID and Client Secret? Also, Google provides two separate URLs: “Authorization Endpoint” (https://accounts.google.com/o/oauth2/v2/auth) and “Token Endpoint” (https://www.googleapis.com/oauth2/v4/token). The former, I assume, is for the exchange of a Client ID/Secret for an Authorization token, and the latter, I assume, is to exchange that Authorization token for an Access Token that can be then used with an "Authorization: Bearer " header? Bubble, however, only appears to take one URL parameter (Token Endpoint).
Any help here is much appreciated. I assume this works the same across various Google APIs on their Cloud Platform, so hopefully some of you may have figured this out. Thank you!