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

Authorization error #89

Open
vitaminx opened this issue Mar 11, 2022 · 3 comments
Open

Authorization error #89

vitaminx opened this issue Mar 11, 2022 · 3 comments

Comments

@vitaminx
Copy link

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?

@nyjx
Copy link

nyjx commented Mar 16, 2022

@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)

@maybecryptic
Copy link

maybecryptic commented Oct 26, 2022

@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

@xxiz
Copy link

xxiz commented Dec 11, 2022

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 👍🏾

y7luedEF

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

4 participants