Skip to main content

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

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

djangorestframework-firebase-0.3.0.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file djangorestframework-firebase-0.3.0.tar.gz.

File metadata

  • Download URL: djangorestframework-firebase-0.3.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for djangorestframework-firebase-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a549c9210886852406479d89a07c2d0da2c40a8fc09d79833b4a477760782839
MD5 2cf1fb2594d508b00f657ed412973b9f
BLAKE2b-256 a7250f69617062642cc76d3979f37ba77bc8dee81ccf29c063b89625b18c9951

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page