Skip to content

Commit

Permalink
googleworkspace#336 use the with_subject method
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jackred8 authored Jul 8, 2022
1 parent bc61a48 commit fd2abb1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gmail/snippet/settings snippets/update_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def update_signature():
for guides on implementing OAuth2 for the application.
"""
creds, _ = google.auth.default()

# If you want to use service account to impersonate a user account
# creds = creds.with_subject('user@yourdomain.com')
try:
# create gmail api client
service = build('gmail', 'v1', credentials=creds)
Expand Down

0 comments on commit fd2abb1

Please sign in to comment.