-
Notifications
You must be signed in to change notification settings - Fork 82
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
wsgi_app.last_request_uri has no attribute 'replace' #69
Comments
@antoscha Hi, would you be able to answer the following questions so we can better troubleshoot the issue?
|
I'm using Python 3.8.1 and python-google-auth-oauthlib 0.4.1 that comes from Arch Linux distribution. |
I'm not able to reproduce the error. Would you mind doing a If you haven't already, you can try creating a separate virtual environment to run your code.
|
Unfortunately, running the code in the virtual environment leads to the same error. I've put a wrong link to Google Drive API in the first message, updated now.
|
facing same issue, any update here. tried with |
never mind, I ended up switching to Chrome browser from Safari and it worked without any problem |
installing latest httplib2 helped. |
I'm having this problem too.
Per the above comment from @mo22 I tried rolling back to the version of Like @zainsohail88 using Safari didn't work at all (i.e. using Safari, I never even get to the FWIW, I was able to get unblocked by using the out-of-band workflow outlined in https://github.com/googleapis/google-auth-library-python-oauthlib/blob/master/google_auth_oauthlib/flow.py That said, for a "quickstart" this |
For what it's worth, I was able to reproduce this error by running the quickstart and waiting about 10-15 seconds before clicking allow. This might not be everyone's case here but perhaps it'd help someone else stepping in: did you take a long time before clicking allow? |
For me, this problem only occurred in Safari. Was not there when I tried Chrome. |
This is a problem for both Chrome and Safari for me. As a matter of fact, any browser that refuses to use http for oauth2 redirect url doesn't work. In short, during the oauth2, a web server is running. This temporary web server only supports http and not https. wsgi_app never gets to see the redirected URL as it is only listening to http - which is where the auth token is. In other word, web browser was told to redirect to "http://localhost:PORT:/?state=..." but instead, it swaps the http with https and tries to access, so the wsgi_app never gets the URL back, and therefore, the crash happens. This has nothing to do with the library version or anything. Web browser is not redirecting to the URL that it got from Google. |
If you are having this problem with Chrome, this is how to make it work. Open the Chrome setting. chrome://net-internals/#hsts There is a "Delete domain security policies". Put in "localhost" to Domain: input, and hit Delete. Now, the localhost is excluded from http -> https redirection. |
This has done the trick for me, thanks! |
FWIW, I'm also experiencing this on firefox now. And the sole reason I'm encountering this is due to teh push to remove the oob workflow, which is being deprecated (which is earlier mentioned in this thread as one of the workarounds) |
Awesome tricks, thanks so much 🥰🥰 |
How exactly do I get past this error? The quickstart for Google Sheets API references code that simply doesn't work. |
Hi @pembo13 , did you see the messages above by NaoyukiTai?
This has worked for me as well as others after me. Give it a shot. Reasoning here is that your localhost is not offering https connections, so needs to be excluded from the redirect int he browser settings. |
@shu-ha-ri this wasn't it. I was using offline/desktop credentials over SSH. The HTTP local server timing out before I could copy and paste the URL to start the flow. And the server was only binding 127.0.0.1 on the remote machine. I had to fix both these issues to proceed.
|
Is there a generic solution for this "AttributeError: 'NoneType' object has no attribute 'replace'" ? |
I found that I fix this by editing So, it works, but it requires changing google_auth_oauthlib source code. |
Hi,
I have an issue running Google API Quickstart:
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: