3
votes

I am trying without success to "Add Google Sign-In to Your Web App" and then use Node.js with Google Sheets API V4 to be able allow my app to use the sheets api on behalf of the user (with scope: https://www.googleapis.com/auth/spreadsheets).

I'm really confused on how to achieve this. Reading through most of the documentation from OAuth2 doesn't clarify me best practices to achieve this with the Google Sign-In button.

Furthermore, I haven't found any documentation/guides related to this. I was hoping someone can guide me towards the right direction.

P.S: I managed to use the sheets api by following the Node.js quickstart for Sheets API, which allows me to achieve authorization through console, however I believe using the Sign-In button might simplify the process while making a nicer UX.

Thanks!

1

1 Answers

1
votes

Google Sign-In is like what it says, for signing-in. However, it's not enough to authorize you to use Sheets API methods because if you read the Authorize Requests docs, it clearly states that you need to use OAuth2 plus there are scopes to consider (read-only, read/write, etc).

You are correct to follow the guidelines where you used OAuth2.0. Just create your own custom button. Grab a Google button image in the web and use that.