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 account not auth'ing as expected #472

Open
aefruswg opened this issue Aug 7, 2024 · 2 comments
Open

Service account not auth'ing as expected #472

aefruswg opened this issue Aug 7, 2024 · 2 comments

Comments

@aefruswg
Copy link

aefruswg commented Aug 7, 2024

The issue tracker is for reporting product deficiencies. How do I questions should be posted to the discussion forum at https://groups.google.com/group/got-your-back. When in doubt, start at the discussion forum and return here only when instructed to do so.

Please confirm the following:

Full steps to reproduce the issue:

  1. Added the necessary scopes and waited. It's still an issue after about 30 minutes
  2. Hit 'y' during setup for admin use and entered a user's email address
  3. Received the error below. The same occurs when running check-service-account outside of setup

Expected outcome (what are you trying to do?): Use a service account

Actual outcome (what errors or bad behavior do you see instead?):

Checking service account DwD for [email protected]...
Please run

gyb --action create-project
gyb --action check-service-account

to create and configure a service account.
ERROR: None

gyb --action create-project --email [email protected]     
File C:\GYB\oauth2service.json already exists. Please delete or rename it before attempting to create another project.
@jay0lee
Copy link
Member

jay0lee commented Aug 9, 2024

If check-service-account is passing then you should be all set. create-project is failing because you already have a project and GYB doesn't want to overwrite it.

What happens when you actually try to use the service account to backup/restore?

Please show the FULL output of your GYB commands.

@aefruswg
Copy link
Author

aefruswg commented Aug 9, 2024

But that output doesn't confirm or deny that the service account is working. The wording is confusing because I'm telling it to check a service account and the output is telling me to create one rather than confirming one is already configured. There's no affirmation; it's basically saying "task failed successfully". I understand that create-project is throwing an error because there's already an existing one, hence my confusion as to why check-service-account is seemingly going in circles

I initially didn't try using a service account given this ambiguity and was able to do a backup/restore by logging into both the account being backed up and the one receiving the restore. I just tried and here's the output.

gyb --email [email protected] --action backup --local-folder C:\EmailBackups\Test\ --service-account
Traceback (most recent call last):
  File "gyb.py", line 2817, in <module>
  File "gyb.py", line 2045, in main
  File "gyb.py", line 697, in buildGAPIServiceObject
  File "gyb.py", line 1360, in getSvcAcctCredentials
  File "google\oauth2\service_account.py", line 445, in refresh
  File "google\oauth2\_client.py", line 308, in jwt_grant
  File "google\oauth2\_client.py", line 279, in _token_endpoint_request
  File "google\oauth2\_client.py", line 72, in _handle_error_response
google.auth.exceptions.RefreshError: ('unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.', {'error': 'unauthorized_client', 'error_description': 'Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.'})
[10008] Failed to execute script 'gyb' due to unhandled exception!

The scopes were added and approved 2 days ago when I first opened this issue.

Screenshot 2024-08-09 115302

The client ID and secret in the automatically generated client_secrets.json match the information from Google 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

No branches or pull requests

2 participants