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
127 stars 61 forks source link

Viewset Testing not working unless forcing authentication #15

Closed robertsiipola closed 3 years ago

robertsiipola commented 4 years ago

I'm not exactly sure if my issue is with the package itself or not, but here goes.

I've integrated drf-firebase-auth to my project and it seems to work as intended when I'm testing it from my client and with Postman.

However, when I test the views themselves I start getting 403 errors unless I force authenticate. I've submitted a question about this to Stack Overflow as well. Any help would be greatly appreciated.

There's a decent chance that I've just configured DRFs APITestCase settings incorrectly, so this might have nothing to do with the package itself.

garyburgmann commented 4 years ago

Apologies for the late reply, I am snowed under at the moment. I will look at this when I have free time after October 15 2020. Really I should be adding test cases to this codebase anyway.

garyburgmann commented 3 years ago

Hi @robertsiipola,

If you did not figure this out, there is some examples in an impending change, which includes a testapp: https://github.com/garyburgmann/drf-firebase-auth/tree/1.0.0