Google API: getting Credentials from refresh token with oauth2client.client

前端 未结 10 1886
失恋的感觉
失恋的感觉 2020-11-29 05:06

I am using googles official oauth2client.client to access the google plus api. I have a refresh token (that does not expire) stored in a database, and need to recreate the

10条回答
  •  星月不相逢
    2020-11-29 05:08

    You could store the entire credentials rather than only the refresh token:

    json = credentials.to_json()
    credentials = Credentials.new_from_json(json)
    

    Look at the Storage object which does it this way.

提交回复
热议问题