Skip to main content

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

Generate Firebase Credentials

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. 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:

  1. In the Firebase console, open Settings > Service Accounts.
  2. Click Generate New Private Key, then confirm by clicking Generate Key.
  3. Securely store the JSON file containing the key.

Add Firebase credentials to settings.py

Generate Firebase credentials from Firebase console img.png

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

django-firebase-auth-1.0.3.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

django_firebase_auth-1.0.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file django-firebase-auth-1.0.3.tar.gz.

File metadata

  • Download URL: django-firebase-auth-1.0.3.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for django-firebase-auth-1.0.3.tar.gz
Algorithm Hash digest
SHA256 34d9db6da0a0cb5e2d00f33e44f0ba7c9b5e7112102c705d425e3de90d685526
MD5 f6888744a753aedec53076078c856cb0
BLAKE2b-256 c763d2f176c5a819b1d3e88eec92c5a928e0229a37b530b5e3bb1d3aa4b72cd4

See more details on using hashes here.

File details

Details for the file django_firebase_auth-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_firebase_auth-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7d1847046698c1aee2472f2ab2ae00818f1537f520001b8c64fba7797e6a4be4
MD5 924616262bdd17a9f059fcbbf37324f4
BLAKE2b-256 75f9d8612123dc04197f2a0cb109a4cb4b40b7705cf29cc1a3c42ffe21350964

See more details on using hashes here.

Supported by

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