Hi,
I've been creating refresh tokens successfully for some time now, but suddenly it doesn't work, even though I'm using the same code.
----
Waiting for authorization and callback to: http://localhost:8080...
Traceback (most recent call last):
File "/home/.../authenticate_in_web_application.py", line 203, in <module>
main(args.client_secrets_path, configured_scopes)
File "/home/.../authenticate_in_web_application.py", line 81, in main
code = _get_authorization_code(passthrough_val)
File "/home/.../authenticate_in_web_application.py", line 112, in _get_authorization_code
params = _parse_raw_query_params(data)
File "/home/.../authenticate_in_web_application.py", line 160, in _parse_raw_query_params
params = match.group(1)
AttributeError: 'NoneType' object has no attribute 'group'
---
On line 157 of the above file, inside the _parse_raw_query_params(data) function there is this line:
decoded = data.decode("utf-8")
The variable 'decoded' at this point contains the following:
GET / HTTP/1.1
Host: localhost:8080
Connection: keep-alive
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Linux"
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Seems like there should be some args with the GET on the first line?
The next 2 lines are:
match = re.search("GET\s\/\?(.*) ", decoded)
params = match.group(1) <-- Error here (match is 'NoneType')
I re-downloaded the client libaray, and created a fresh virtual environment, but nothing I've tried so far has helped, so if anyone has any ideas, I'd be very grateful!!
Python version is 3.9.10 (but this hasn't changed since it was working last week)
Oliver