garyburgmann / drf-firebase-auth

Firebase backend to receive a user idToken and authenticate via Django REST Framework 'authentication.BaseAuthentication'. Optionally, a new local user can be created in the process.
MIT License
128 stars 62 forks source link

authenticate_token() method called nonexistent firebase_admin.auth.AuthError #26

Closed justin-thurman closed 3 years ago

justin-thurman commented 3 years ago

The authenticate_token() method on the FirebaseAuthentication class was calling firebase_admin.auth.AuthError. This error does not exist, causing the authenticate method to fail.

The most appropriate existing error I could find was firebase_admin.auth.UserNotFoundError, so I updated it with that. A list of all errors available on firebase_admin.auth (if you don't like UserNotFoundError) can be found here: https://firebase.google.com/docs/reference/admin/python/firebase_admin.auth.

garyburgmann commented 3 years ago

Thanks @ViMonks

On work laptop atm. Will merge and push changed package this weekend.

justin-thurman commented 3 years ago

No problem. Thanks for the repo!

garyburgmann commented 3 years ago

this appears to be driven by changes to the firebase_admin SDK introduced in v3:

https://firebase.google.com/docs/admin/migrate-python-v3

will merge change, in addition to pinning the version within setup.py before releasing the new version