Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Create alt_credential_auth.py #157

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions examples/alt_credential_auth.py
Original file line number Diff line number Diff line change
@@ -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)
patcon marked this conversation as resolved.
Show resolved Hide resolved

gauth = GoogleAuth()
gauth.credentials = creds

drive = GoogleDrive(gauth)

# Now do stuff as normal!