Google spreadsheet api Request had insufficient authentication scopes

前端 未结 9 1844
既然无缘
既然无缘 2020-11-29 07:45

I\'m making an script to read data from google spreadsheet using the following script on nodejs:

var url = oauth2Client.generateAuthUrl({
    access_type:            


        
9条回答
  •  难免孤独
    2020-11-29 08:32

    1. Firstly delete the credentials files ~/.credentials/sheets.googleapis.com-nodejs-quickstart.json (depending on your setting)

    2. Change the scope variable used for reading cells from Google Spreadsheets from

    var SCOPES = ['https://www.googleapis.com/auth/spreadsheets.readonly'];

    to

    var SCOPES = ['https://www.googleapis.com/auth/spreadsheets'];

    1. After the execution of code, API will authenticate again and then the issue will be resolved.

提交回复
热议问题