Skip to content

Commit fd2abb1

Browse files
authored
googleworkspace#336 use the with_subject method
If you have delegated domain-wide access to the service account and you want to impersonate a user account, use the with_subject method of an existing ServiceAccountCredentials object.
1 parent bc61a48 commit fd2abb1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gmail/snippet/settings snippets/update_signature.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def update_signature():
3030
for guides on implementing OAuth2 for the application.
3131
"""
3232
creds, _ = google.auth.default()
33-
33+
# If you want to use service account to impersonate a user account
34+
# creds = creds.with_subject('[email protected]')
3435
try:
3536
# create gmail api client
3637
service = build('gmail', 'v1', credentials=creds)

0 commit comments

Comments
 (0)