Skip to main content

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/*

Metadata

Release files for djangorestframework-firebase 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djangorestframework-firebase 0.3.0
File Size Uploaded
djangorestframework-firebase-0.3.0.tar.gz 4.7 kB Details

Release files / djangorestframework-firebase-0.3.0.tar.gz

Download URL djangorestframework-firebase-0.3.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a549c9210886852406479d89a07c2d0da2c40a8fc09d79833b4a477760782839
BLAKE2b-256 checksum
How to use checksums
a7250f69617062642cc76d3979f37ba77bc8dee81ccf29c063b89625b18c9951
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

0.2.0

1 release file

0.1.3

1 release file

0.1.2

2 release files

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page