PyDrive
PyDrive copied to clipboard
Support using existing access tokens
I am using PyDrive with Flask-Dance , I would like to use the live access token stored in the Flask session by Flask dance with PyDrive, is there any way to short cut the very well meaning auth object and directly give it the access token to use with the rest of the PyDrive calls ?
Very similar to #10 would appreciate a concrete sample in the docs, specifically for Flask-Dance.
Here is my solution for posterity:
- Obtain the auth info stored in the session by Flask-Dance
oauth_token = session['google_oauth_token'] - Create credentials from flask context and session with right amount of dict->json->dict HACK
All this is capture in this gist
Please follow up with any more elegant solution that comes to mind. P.S. Flask Dance scope need to be expanded to include whichever Drive scopes that the application uses.