Authorizing requests with OAuth 2.0 in Google Spreadsheet API

后端 未结 4 1152
一个人的身影
一个人的身影 2021-01-06 05:08

I am trying to create a PHP web page that requires reading some data from a google spreadsheet in my domain (I am using Google Apps Free Edition).

The spreadsheet t

4条回答
  •  天涯浪人
    2021-01-06 05:52

    Google & OAuth tutorial: I searched for days to find this. It is far better then any other OAuth style tutorial I have used. It is for connecting to Google Docs/google drive.

    Python example is here, also see other examples for java etc: https://developers.google.com/drive/examples/python

    Note you need to add refresh token to it. But that works just as you would expect.

    Also to connect to the spreadsheet use:

              SpreadsheetService service =
                      new SpreadsheetService("MySpreadsheetIntegration-v1");
    
              service.setHeader("Authorization", "Bearer " + accessToken);
    

提交回复
热议问题