Pyrebase icon indicating copy to clipboard operation
Pyrebase copied to clipboard

Use google-auth instead of oauth2client

Open heston opened this issue 8 years ago • 12 comments

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.

heston avatar Mar 29 '18 05:03 heston

@thisbejim Thoughts on getting this merged?

heston avatar Mar 31 '18 15:03 heston

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

quoctc avatar Apr 24 '18 09:04 quoctc

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

quoctc avatar Apr 25 '18 03:04 quoctc

I'm experiencing the intermittent 401 problem as well. Please merge the google-auth branch with master

rawmean avatar May 07 '18 22:05 rawmean

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

heston avatar May 17 '18 15:05 heston

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!

quoctc avatar May 18 '18 00:05 quoctc

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

lepture avatar Jun 14 '18 06:06 lepture

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

Rumidom avatar Dec 11 '18 15:12 Rumidom

@heston how can I install this version ?

abdelwahebmoalla avatar Jan 13 '19 21:01 abdelwahebmoalla

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

heston avatar Jan 13 '19 22:01 heston

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

abdelwahebmoalla avatar Feb 19 '19 13:02 abdelwahebmoalla

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

s2t2 avatar May 18 '22 21:05 s2t2