Use google-auth instead of oauth2client
This replaces the now deprecated oauth2client with google-auth. This should fix issues with token expiration.
n.b. I also sorted the imports at the top of pyrebase.py to be compliant with PEP 8.
@thisbejim Thoughts on getting this merged?
Hi @thisbejim Do you have any plan to merge this branch into master? I have the same issue and still waiting it's merged
Thank for your support
hi @heston .
I have just tried with my application, but I think it seem to do not fix the issue: I show you my logs, do you have any idea? https://screencast.com/t/ur34PxSm6NHV
I'm experiencing the intermittent 401 problem as well. Please merge the google-auth branch with master
@quoctc It looks like the oauth2 request is returning a 200 (https://accounts.google.com/o/oauth2/token), but your other endpoint (/leds/0/status.json?...) is returning a 401. It's a little hard to tell exactly what's going on, since I'm not familiar with your code. However, it could mean that the leds endpoint is not properly authenticating with the oauth2 token.
hi @heston , Sorry I'm busy these day. So I was not uppdated my problem at here. My application was worked fine. Thank you. This fix soo great!
It would be better if we can pass a requests.Session argument, in this case, we can use other library as well. For instance, we can pass a session into gspread, e.g. https://blog.authlib.org/2018/authlib-for-gspread
im not sure if it is only on my pc, but after installing this PR i got an error : ModuleNotFoundError: No module named 'google.auth'
pip install google.auth and pip install --upgrade google-cloud-storage
solved the issue
@heston how can I install this version ?
@abdelwahebmoalla I install it in "editable" mode directly from GitHub:
pip install -e git+https://github.com/heston/Pyrebase.git@a77bd6f6def656b1dcd77d938fac2707f3c4ba61#egg=Pyrebase
This has some drawbacks (mainly, it's slow, since it has to clone the repo), but generally works fine.
For everyone using this version there has been an update to firebase and other changes should be done you can consult this issue for more details https://github.com/thisbejim/Pyrebase/issues/294
The oauth2client package is deprecated in favor of google-auth, but we need pyrebase to offer a new version with the change.
https://github.com/googleapis/oauth2client