Using Spreadsheet API OAuth2 with Certificate Authentication

邮差的信 提交于 2019-12-04 18:21:45

I solved it by using OAuth2TokenFromCredentials

    credentials = SignedJwtAssertionCredentials(
                    SERVICE_ACCOUNT_EMAIL,
                    PRIVATE_KEY,
                    scope = SCOPE,
                    sub = "admin@domain.com")
    auth2token = gauth.OAuth2TokenFromCredentials(credentials)
    client = SpreadsheetsClient()
    auth2token.authorize(client)
    q = SpreadsheetQuery(title= "ItemMaster",title_exact=True,)
    feed = client.get_spreadsheets(query = q)
    self.response.write(feed)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!