Firebase based authentication for Django REST framework
Project description
# Django Rest Framework Firebase Auth
## Installation
```
pip install djangorestframework-firebase
```
On your project's `settings.py` add this to the `REST_FRAMEWORK` configuration
```
REST_FRAMEWORK = {
...
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_firebase.authentication.FirebaseAuthentication',
)
...
}
```
Get admin credentials `.json` from the Firebase SDK and add them to your project
Also in your project's `settings.py` :
```
FIREBASE_AUTH = {
'FIREBASE_ACCOUNT_KEY_FILE': 'path_to_your_credentials.json',
}
```
Alternatively, you can configure the Firebase credentials directly, like so:
```
FIREBASE_AUTH = {
'FIREBASE_CREDENTIALS': {
'type': "service_account",
'project_id': "",
'private_key_id': "",
'private_key': "",
'client_email': "",
'client_id': "",
'auth_uri': "https://accounts.google.com/o/oauth2/auth",
'token_uri': "https://accounts.google.com/o/oauth2/token",
'auth_provider_x509_cert_url': "https://www.googleapis.com/oauth2/v1/certs",
'client_x509_cert_url': ""
}
}
```
## Publishing
`python setup.py sdist`
`twine upload dist/*`
## Installation
```
pip install djangorestframework-firebase
```
On your project's `settings.py` add this to the `REST_FRAMEWORK` configuration
```
REST_FRAMEWORK = {
...
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_firebase.authentication.FirebaseAuthentication',
)
...
}
```
Get admin credentials `.json` from the Firebase SDK and add them to your project
Also in your project's `settings.py` :
```
FIREBASE_AUTH = {
'FIREBASE_ACCOUNT_KEY_FILE': 'path_to_your_credentials.json',
}
```
Alternatively, you can configure the Firebase credentials directly, like so:
```
FIREBASE_AUTH = {
'FIREBASE_CREDENTIALS': {
'type': "service_account",
'project_id': "",
'private_key_id': "",
'private_key': "",
'client_email': "",
'client_id': "",
'auth_uri': "https://accounts.google.com/o/oauth2/auth",
'token_uri': "https://accounts.google.com/o/oauth2/token",
'auth_provider_x509_cert_url': "https://www.googleapis.com/oauth2/v1/certs",
'client_x509_cert_url': ""
}
}
```
## Publishing
`python setup.py sdist`
`twine upload dist/*`
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file djangorestframework-firebase-0.2.0.tar.gz.
File metadata
- Download URL: djangorestframework-firebase-0.2.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.13.0 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3338c1d19d4316de7ea76d31eace96aae1ccf042aaf5455426af8d470685bb9a
|
|
| MD5 |
87af4ca6b369bd57ea72073b174a7f65
|
|
| BLAKE2b-256 |
1ba4a326252987bc4e881aceb32b60de87d52b311a258c1fdad7acbdadc22331
|