Google Drive/OAuth - Can't figure out how to get re-usable GoogleCredentials

前端 未结 3 2234
無奈伤痛
無奈伤痛 2021-02-20 05:51

I\'ve successfully installed and run the Google Drive Quick Start application called DriveCommandLine. I\'ve also adapted it a little to GET file info for one of the files in my

3条回答
  •  迷失自我
    2021-02-20 06:26

    I feel your pain. I'm two months in and still getting surprised.

    Some of my learnings...

    • When you request user permissions, specify "offline=true". This will ("sometimes" sic) return a refreshtoken, which is as good as a password with restricted permissions. You can store this and reuse it at any time (until the user revokes it) to fetch an access token.

    • My feeling is that the Google SDKs are more of a hinderence than a help. One by one, I've stopped using them and now call the REST API directly.

    • On your last point, you can (just) use the Google clientlogin protocol to access the previous generation of APIs. However this is totally deprecated and will shortly be turned off. OAuth is designed to give fine grained control of authorisation which is intrinsically complex. So although I agree it's complicated, I don't think it's unnecessarily so. We live in a complicated world :-)

    Your and mine experiences show that the development community is still in need of a consolidated document and recipes to get this stuff into our rear-view mirrors so we can focus on the task at hand.

提交回复
热议问题