from oauth2client.appengine import StorageByKeyName
from oauth2client.client import OAuth2WebServerFlow
from oauth2client.tools import run
KEY_NAME = 'your_choice_here'
CREDENTIALS_PROPERTY_NAME = 'credentials'
SCOPE = 'https://www.googleapis.com/auth/drive'
storage = StorageByKeyName(CredentialsModel, KEY_NAME,
    CREDENTIALS_PROPERTY_NAME)
flow = OAuth2WebServerFlow(client_id=YOUR_CLIENT_ID, client_secret=
    YOUR_CLIENT_SECRET, scope=SCOPE)
run(flow, storage)
How can I log in to an arbitrary user in appengine for use with the Drive SDK?