Skip to main content

# graphene-django-firebase-auth

Authentication provider for graphene-django and Firebase’s Authentication service.

Note this is a WIP and abandoned project since I never ended up using Firebase. But the code is still a good starting point as of writing this.

Partially inspired by [django-firebase-auth](https://github.com/fcornelius/django-firebase-auth) for Django REST framework.

This app is used with [Firebase Authentication](https://firebase.google.com/docs/auth/) on a client.

## Compatibility

This code has only been tested with Python 3.7.0 and Django 2.1.2.

## Installing

  1. Install the app:

`sh pipenv install graphene-django-firebase-auth `

  1. Download the JSON file from your [Firebase console](https://console.firebase.google.com/) with your account’s credentials.

  2. Set FIREBASE_KEY_FILE in your project’s settings to the path of the credentials file:

`python import os FIREBASE_KEY_FILE = os.path.join(BASE_DIR, 'path/to/firebase-credentials.json') `

  1. Add the authentication backend to AUTHENTICATION_BACKENDS:

`python AUTHENTICATION_BACKENDS = ['firebase_auth.authentication.FirebaseAuthentication'] `

  1. Add firebase_auth to INSTALLED_APPS:

`python INSTALLED_APPS = [ 'firebase_auth', ] `

  1. Add FirebaseAuthMixin to your AUTH_USER_MODEL:

`python class User(PermissionsMixin, FirebaseAuthMixin): `

  1. Build and run your DB migrations to add the changes:

`sh ./manage.py makemigrations ./manage.py migrate `

## Sending tokens on the client

Your client will need to send an Authorization: Bearer token on each request. How you do this depends on your client and is outside the scope of this documentation.

## Developing

### Setting up your environment

  1. Install the dependencies:

`sh pipenv install -d `

  1. Download the JSON file from your [Firebase console](https://console.firebase.google.com/) with your account’s credentials.

  2. Create an .env file using .env.example as a template. Make sure to specify the path to the file in the previous step.

  3. Enter the virtual environment:

`sh ./manage.py shell `

### Other commands

`sh # Run the tests ./manage.py test `

`sh # Lint the code ./lint.sh `

Metadata

Release files for graphene-django-firebase-auth 0.0.22

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

Source distribution (sdist)

Source distribution for graphene-django-firebase-auth 0.0.22
File Size Uploaded Provenance Actions
graphene_django_firebase_auth-0.0.22.tar.gz 4.5 kB Without provenance Details for graphene_django_firebase_auth-0.0.22.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for graphene-django-firebase-auth 0.0.22
File Interpreter ABI Platform Actions
graphene_django_firebase_auth-0.0.22-py3-none-any.whl Python 3 none any Details for graphene_django_firebase_auth-0.0.22-py3-none-any.whl

Total release size: 10.1 kB

Release files / graphene_django_firebase_auth-0.0.22.tar.gz

Download URL graphene_django_firebase_auth-0.0.22.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
da3b6f44f42196bb1c385fc0e23da2b50bb89aca08611ed56b3f890bcc9914b3
BLAKE2b-256 checksum
How to use checksums
5eabb22bc763444c9a556d73cc082b02af265313904e8c87467aa9f527819bbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / graphene_django_firebase_auth-0.0.22-py3-none-any.whl

Download URL graphene_django_firebase_auth-0.0.22-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08957a69662fb3dfb549b20a2493b11eb67e8c1ed342fd9bccf9f0fc8cce64e8
BLAKE2b-256 checksum
How to use checksums
ca9c2beba0415bf08869d35ec9ff16ca98c17ff4b7d17d07a00e1e12e4c492f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Security for graphene-django-firebase-auth 0.0.22

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.22 This release

2 release files No provenance

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