Django authentication middle ware using Firebase Authentication Service
Project description
Django Firebase Auth
Project provide Django authentication middle ware using Firebase Authentication Service
Requirements
Installation
pip install django-firebase-auth
Usage
Settings
1. Setting credentials
- Credentials from file
FIREBASE_CREDENTIALS_FILE = '<YOUR FIREBASE CREDENTIALS PATH>' # 'firebase-credentials.json'
- or using credentials from json dict (where you can use as environment variables )
Using credentials from json dict
FIREBASE_CREDENTIALS_DICT = {
"type": "service_account",
"project_id": "<YOUR PROJECT ID>",
"private_key_id": "<YOUR PRIVATE KEY ID>",
"private_key": '<YOUR PRIVATE KEY>',
"client_email": "<CLIENT EMAIL>",
"client_id": "<CLIENT ID>",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "<CERT URL>"
}
2. Add installed apps:
INSTALLED_APPS = [
"...",
"django_firebase_auth",
]
3. Setting authentication backend
REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": (
"django_firebase_auth.firebase_auth.FirebaseAuthentication",
),
}
Generate Firebase Credentials file
To generate a private key file for your service account:
- In the Firebase console, open Settings > Service Accounts.
- Click Generate New Private Key, then confirm by clicking Generate Key.
- Securely store the JSON file containing the key.
Add Firebase credentials to settings.py
Generate Firebase credentials from Firebase console
TODO:
- Support supabase
- Optimize session management
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-firebase-auth-1.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4415897cec30fe075ac881d61c77b6c699adf34a68903b52fdee37893dd2d56 |
|
MD5 | 8e0462431eb04075188ae0dd947321c5 |
|
BLAKE2b-256 | c7d2ce0ecde57b5ea3d91c82765fb1b3d99b7c7bbf39807a267d383d990d5407 |
Close
Hashes for django_firebase_auth-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d45f399c68246fc463316b6e84c21fadc606f2371051459d92d759a815232c6 |
|
MD5 | 4b93c33e44ed3dde128a575d6d9076f0 |
|
BLAKE2b-256 | a73efd324bf03ed6b6cb0a8920344a7c8a51354d56f3b0b2cacaeb627ce1b1de |