Authorization error
vitaminx opened this issue · comments
Authorization error
Error 400: invalid_request
You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy for app security.
You can notify the app developer that the app doesn't comply with one or more of Google's verification rules.
Request Details
The content in this section is provided by the app developer. This content has not been reviewed or verified by Google.
If you are an app developer, please ensure that these request details comply with Google policies.
redirect_uri: urn:ietf:wg:oauth:2.0:oob
Seems like the script needs to be updated?
@vitaminx
comment
creds = flow.run_console()
in original code.
use the flow.run_local_server with little mods.
creds = flow.run_local_server(port=0, open_browser=False)
works for me on local machine creating SA.
haven't try this on remote machine creating SA. (I don't expect it to work)
@nyjx when I do that I get
Traceback (most recent call last):
File "gen_sa_accounts.py", line 317, in <module>
resp = serviceaccountfactory(
File "gen_sa_accounts.py", line 179, in serviceaccountfactory
creds = flow.run_local_server(port=0, open_browser=False)
File "Python\Python310\lib\site-packages\google_auth_oauthlib\flow.py", line 516, in run_local_server
authorization_response = wsgi_app.last_request_uri.replace("http", "https")
AttributeError: 'NoneType' object has no attribute 'replace'
EDIT: fixed by running install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
Got the following error when trying to run python add_to_google_group.py -g service@my.domain
Traceback (most recent call last):
File "C:\Users\...\AutoRclone\add_to_google_group.py", line 43, in <module>
flow = InstalledAppFlow.from_client_secrets_file(credentials[0], scopes=[
IndexError: list index out of range
Tried using creds = flow.run_local_server(port=0, open_browser=False)
to no avail.
Does anyone have any other ideas, thanks?
EDIT: I found the problem it was because the token.pickle
was not identified correctly.
It looks for the token file in credentials/token.pickle
when it is inside the project directory. Created PR #99 👍🏾