Skip to content

Add optional subject delegation support for service account authentication#4

Open
varelaerick wants to merge 2 commits intogoogleads:mainfrom
varelaerick:main
Open

Add optional subject delegation support for service account authentication#4
varelaerick wants to merge 2 commits intogoogleads:mainfrom
varelaerick:main

Conversation

@varelaerick
Copy link

Add support for user impersonation via GOOGLE_ADS_SUBJECT environment variable when using service account credentials.

Changes:

  • Add _get_subject() function to read subject from environment
  • Enhance _create_credentials() to apply subject delegation for service accounts
  • Maintain full backward compatibility - no changes to existing behavior
  • Add logging for authentication method used

Usage:
Set GOOGLE_ADS_SUBJECT=user@example.com when using service account credentials with domain-wide delegation enabled.

Requirements:

  • Service account credentials (not OAuth)
  • Domain-wide delegation configured in Google Workspace Admin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant