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

Error 400: Invalid request #42

Open
sharonkatz510 opened this issue Oct 19, 2022 · 3 comments
Open

Error 400: Invalid request #42

sharonkatz510 opened this issue Oct 19, 2022 · 3 comments

Comments

@sharonkatz510
Copy link

Hey, first off thanks alot for your effort. When I try to run the terminal command it gives me a link for authorization.
However when I press the link I get the following error message from google:

Error 400: invalid_request
The out-of-band (OOB) flow has been blocked in order to keep users secure. Follow the Out-of-Band (OOB) flow Migration Guide linked in the developer docs below to migrate your app to an alternative method.
Request details: redirect_uri=urn:ietf:wg:oauth:2.0:oob

Google's suggested solution seems simple:
image

however I'm not sure how it can be implemnted into your code.

Would really appreciate your help on this.
Thanks.

@dan-riley
Copy link

Just ran into this as well after finally figuring out how to setup the client json. The above is just code to advise users that it's being shutdown. It appears the actual solution that has to be implemented is here: https://developers.google.com/identity/protocols/oauth2/native-app#redirect-uri_loopback but I don't think it's very straightforward.

@dan-riley
Copy link

Actually found a hacky solution. In transfer.py, change

flow.redirect_uri = oauth2client.client.OOB_CALLBACK_URN

to

flow.redirect_uri = "https://localhost"

In your browser when you paste the link provided when you run transfer.py, it will now allow you to login and authorize Recurse, but then give an error. But in the URL there will be a code= and that's the code needed! Not sure how long this will work but at least for now it does!

@wildintellect
Copy link

I got it to work with a change to the flow, but will only work on non-headless systems (you need a web browser on the same machine) https://github.com/wildintellect/google-drive-recursive-ownership/tree/fix/oob

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

3 participants