[Google Sheets Connector] How to configure the Google settings?

[Google Sheets Connector] How to configure the Google settings?

  
Forge Component
(4)
Published on 1 Nov by João Pedro Abreu
4 votes
Published on 1 Nov by João Pedro Abreu

Hi João!

Thank you for sharing this component.

I'm having a hard time configuring the required Google API settings to have the demo running.

I went to https://console.developers.google.com/apis/credentials/oauthclient and selected Web Application on the Application Type.

Question 1: on Authorised redirect URIs, shall I put https://<my personal area name>.outsystemscloud.com/GoogleServicesOAuth2/AuthorizationResponse.aspx?

I went to Service Center and set the client ID and secret on the Site Properties of GoogleServicesOAuth2

With these settings, when running your demo, I'm able to sign-in on Google and select my Google Account; then I see the Allow page "View and manage your spreadsheets in Google Drive"

But when I click "Allow", it redirects to the OutSystems Application with error "Google authorization could not be completed!
Please try again later."

Question 2: May you please inform what is missing? On Service Center Log I have a "403 Forbidden" error. Do I need to make a domain verification on Credentials/Domain verification? If that is the case, which domain needs verification? olivier.outsystemscloud.com, olivier.outsystemscloud.com/GoogleServicesOAuth2 or olivier.outsystemscloud.com/GoogleSheetsDemo, or other?


Thank you for your support, Olivier

Hi Olivier!


Answer 1: Yes, the the Application Type should be Web Application and the authorized redirect URL should be https://yourpersonalarea.outsystemscloud.com/GoogleServicesOAuth2/AuthorizationResponse.aspx.

Answer 2: Since you have set the client ID and secret in Service Center, the issue may be that you also need to enable the Google+ API. This is something that I may need to change but, for now, the AuthorizationResponse screen makes a call to a Google+ API, in order to retrieve the google account's email address.

For my tests, I also added my personal area (https://setilight.outsystemscloud.com) to the authorized javascript origins. I'm not sure if it's required, though.


Let me know if that fixed your problem!

Thank you João for your prompt reply!

Indeed, I only had enabled Google Drive API. I now also enabled Google+ API and the authorization worked fine. I now get a screen on the GoogleSheetsDemo/Authorize with my Google login, the scope https://www.googleapis.com/auth/spreadsheets and last updated date


But the read & write actions are not still working. I get a "403 Forbidden" (module REST (Consume), stack 403 Forbidden at ssGoogleSheetsConnector.CcGoogleSheetsAPI.ActionGetValues).

I insert the Spreadsheet ID as described, but the "Test" button fails with the error above. I've also added the Javascript origin authorization, but it didn't have any effect.

I'm pretty sure I set the correct inputs (Spreadsheet ID and sheet name) on the Demo, I'm the developer of the old Google Spreadsheet API   


Any ideas    ?


Regards, Olivier


I've tested reading and writing to spreadsheets I owned and to spreadsheets that were shared with me with Edit permissions. The only case where I got a 403 Forbidden error, while being authenticated, was when trying to access a spreadsheet that my account didn't have access to.

I suggest you double check if the account you authorized has edit access to the spreadsheet. If you find that the account you used has access, I'll probably ask you for help reproducing the issue.

It's working!!!   

The problem was with the API enabled: I had authorized Google Drive API, but the correct autorization is Google Sheets.


Thank you for your support! May I vote for the "Find" option as the next implementation   ?

Regards, Olivier