Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Accounts #12

Closed
wants to merge 11 commits into from
Closed

Service Accounts #12

wants to merge 11 commits into from

Conversation

andyoneal
Copy link

I got this working using a service account. It requires you to delegate domain-wide authority to the service account, which requires you to have G Suite. The G Suite admin will need to add the Client ID of the service account with the scope "https://www.googleapis.com/auth/webmasters.readonly".

After the service account is setup correctly, the code mostly worked as-is. I only added the scope and the user the service account is impersonating to the auth process. Compared to the existing quickstart example, I only changed line 2 to account = searchconsole.authenticate(service_account='client_secrets.json', user_email='[email protected]') and the experience is identical, obviously excluding the interactive parts.

@joshcarty
Copy link
Owner

Hi @andyoneal - sorry for being so slow getting back to you. Really appreciate the contribution!

Is this functionality different to the service account feature implemented in this service-accounts branch?

There's some discussion of service accounts and my reluctance to merge without a service account to test with here.

@andyoneal andyoneal closed this Sep 13, 2023
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.

2 participants