[英]How to use authenticate a user for google sheets api on a remote server using Node.js?
I am working with Google sheets and node.js and I am able to authorize a user locally and get auth data using cmd using this tutorial https://developers.google.com/sheets/api/quickstart/nodejs but cant authorize it on a remote server like Heroku so I have found an example https://codelabs.developers.google.com/codelabs/sheets-api/#4 but can't really grasp how to implement it in this example https://developers.google.com/sheets/api/quickstart/nodejs . 我正在使用Google表格和node.js,并且能够使用本教程https://developers.google.com/sheets/api/quickstart/nodejs使用cmd在本地授权用户并获取身份验证数据,但无法在像Heroku这样的远程服务器,所以我找到了一个示例https://codelabs.developers.google.com/codelabs/sheets-api/#4,但是在这个示例https:// developers中并不能真正掌握如何实现它。 google.com/sheets/api/quickstart/nodejs 。
Thanks in Advance!! 提前致谢!!
Depending on your requirements and architecture, it may make sense to write to the spreadsheet using a service account . 根据您的要求和体系结构,使用服务帐户写入电子表格可能很有意义。 Here is my code for doing that from NodeJS . 这是我从NodeJS执行此操作的代码 。
Advantages of service accounts: 服务帐户的优势:
Disadvantage: 坏处:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.