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

Import_projects.py authentication #3

Open
Lance752 opened this issue Mar 30, 2018 · 2 comments
Open

Import_projects.py authentication #3

Lance752 opened this issue Mar 30, 2018 · 2 comments

Comments

@Lance752
Copy link

Hi Lukas,
Thanks for creating and sharing this script and all of your gcp-tools it is very much appreciated. I'm getting the error below despite the client id for the service account having been granted the needed 2lo scopes in the G Suite console.

Retrieving users from Google Admin SDK Directory API...
Traceback (most recent call last):
File "C:\gcp-tools\import_projects.py", line 315, in
main()
File "C:\gcp-tools\import_projects.py", line 273, in main
users = get_domain_users(admin)
File "C:\gcp-tools\import_projects.py", line 109, in get_domain_users
users = admin.get_users()
File "C:\gcp-tools\lib\google.py", line 488, in get_users
users_list = request.execute()
File "C:\Python27\lib\site-packages\oauth2client_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "C:\Python27\lib\site-packages\googleapiclient\http.py", line 836, in execute
method=str(self.method), body=self.body, headers=self.headers)
File "C:\Python27\lib\site-packages\googleapiclient\http.py", line 167, in _retry_request
resp, content = http.request(uri, method, *args, **kwargs)
File "C:\Python27\lib\site-packages\oauth2client\transport.py", line 159, in new_request
credentials._refresh(orig_request_method)
File "C:\Python27\lib\site-packages\oauth2client\client.py", line 749, in _refresh
self._do_refresh_request(http)
File "C:\Python27\lib\site-packages\oauth2client\client.py", line 819, in _do_refresh_request
raise HttpAccessTokenRefreshError(error_msg, status=resp.status)
oauth2client.client.HttpAccessTokenRefreshError: unauthorized_client: Client is unauthorized to retrieve access tokens using this method.

@lukwam
Copy link
Owner

lukwam commented Mar 30, 2018 via email

@Lance752
Copy link
Author

Lance752 commented Apr 2, 2018

hmm I gave it https://www.google.apis.com/auth/admin.directory.user, https://www.google.apis.com/auth/cloud-platform in the G Suite console from your article and double checked DwD was enabled. Am I missing a scope?

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