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
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
File details
Details for the file django-firebase-auth-1.0.6.tar.gz
.
File metadata
- Download URL: django-firebase-auth-1.0.6.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d62a0b6e078a47c48fdf21e9c24ececa5745e6bd6070cdcf1560de0c319f0287 |
|
MD5 | 192dc8cdaf26443477045fe18bf792cc |
|
BLAKE2b-256 | 26d40e67cb63e5ae6b10eaedf1d6f2b7b69eac32284e874b8b396f4010cc7366 |
File details
Details for the file django_firebase_auth-1.0.6-py3-none-any.whl
.
File metadata
- Download URL: django_firebase_auth-1.0.6-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6502ee01a645f70b6e8eb8fc6835c9d12f676c288b9fb06bd8c34562e551dcad |
|
MD5 | 622c2a0cb2e6c6cb073bcbf14820fe7a |
|
BLAKE2b-256 | cffff14164e1cb4735faf7d2eda58be35b0978a245d0fedb94e48b480308791d |