diff --git a/examples/alt_credential_auth.py b/examples/alt_credential_auth.py new file mode 100644 index 0000000..961c84b --- /dev/null +++ b/examples/alt_credential_auth.py @@ -0,0 +1,13 @@ +from oauth2client.service_account import ServiceAccountCredentials +from pydrive.auth import GoogleAuth +from pydrive.drive import GoogleDrive + +GOOGLE_SCOPES = ['https://www.googleapis.com/auth/drive'] +creds = ServiceAccountCredentials.from_json_keyfile_name('service-key.json', GOOGLE_SCOPES) + +gauth = GoogleAuth() +gauth.credentials = creds + +drive = GoogleDrive(gauth) + +# Now do stuff as normal!