A Django REST Wrapper for Firebase Authentication with DRF.
Firebase Authentication Home Page
Phone Number Authentication - 1
Phone Number Authentication - 2
- ✨ Frontend built using Material Design Lite
- ⭐ Easily Integrates with Django and Django REST Framework (DRF)
- 🔥 Firebase Authentication included
- Supported Authentication Methods:
- 📲 Phone Number Authentication (Visible/Invisble reCaptcha)
- 📧 Email Link & Email + Password Authentication
- 🕵️ Anonymous Authentication
- 🌈Customizable color scheme
- 🕸 Support for WebSocket Authentication with Firebase for channels
Python >= 3.8
Django >= 3.9
git clone https://github.com/wh0th3h3llam1/drf-firebase-auth.git
Add the FirebaseAuthentication
class to DEFAULT_AUTHENTICATION_CLASSES
REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": (
"drf_firebase_auth.authentication.FirebaseAuthentication",
"rest_framework.authentication.TokenAuthentication",
...
)
...
}
Inherit your default User
model from AbstractFirebaseUser
class User(AbstractFirebaseUser, PermissionsMixin):
profile_image = models.ImageField(
upload_to="user/profile_images",
blank=True, null=True
)
...
The AbstractFirebaseUser
model provided is designed to be compatible with Phone Number Authentication so phone_number
is a "required and unique" field.
In case it's not required, you can edit the abstract model as per your requirements
urlpatterns = [
...
path("firebase/", include("drf_firebase_auth.urls")),
...
]
- Navigate to http://127.0.0.1:8000/firebase
Got any issues or suggestions?
Open a Issue
MIT