django-graphene-firebase-auth


Namedjango-graphene-firebase-auth JSON
Version 0.0.31 PyPI version JSON
download
home_pagehttps://github.com/eba-alemayehu/graphene-django-firebase-auth
SummaryAuthentication provider for graphene-django and Google Firebase's Authentication service.
upload_time2024-04-27 08:22:22
maintainerNone
docs_urlNone
authorEba Alemayehu
requires_pythonNone
licenseMIT
keywords graphene django firebase auth
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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
```

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

3. 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')
```

4. Add the authentication backend to `AUTHENTICATION_BACKENDS`:

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

5. Add `firebase_auth` to `INSTALLED_APPS`:

```python
INSTALLED_APPS = [
'firebase_auth',
]
```

6. Add `FirebaseAuthMixin` to your `AUTH_USER_MODEL`:

```python
class User(PermissionsMixin, FirebaseAuthMixin):
```

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

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

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

4. Enter the virtual environment:

```sh
./manage.py shell
```

### Other commands

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

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eba-alemayehu/graphene-django-firebase-auth",
    "name": "django-graphene-firebase-auth",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "graphene django firebase auth",
    "author": "Eba Alemayehu",
    "author_email": "ebaalemayhu3@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a7/10/7b5bd93465278a74b00a7948d668a23d1d1d36b735675350c4dc454a5913/django_graphene_firebase_auth-0.0.31.tar.gz",
    "platform": null,
    "description": "# graphene-django-firebase-auth\n\nAuthentication provider for graphene-django and Firebase's Authentication service.\n\nNote this is a WIP and abandoned project since I never ended up using Firebase. But the code is still a good starting\npoint as of writing this.\n\nPartially inspired by\n[django-firebase-auth](https://github.com/fcornelius/django-firebase-auth)\nfor Django REST framework.\n\nThis app is used with [Firebase Authentication](https://firebase.google.com/docs/auth/) on a client.\n\n## Compatibility\n\nThis code has only been tested with Python `3.7.0` and Django `2.1.2`.\n\n## Installing\n\n1. Install the app:\n\n```sh\npipenv install graphene-django-firebase-auth\n```\n\n2. Download the JSON file from your [Firebase console](https://console.firebase.google.com/) with your account's\n   credentials.\n\n3. Set `FIREBASE_KEY_FILE` in your project's settings to the path of the credentials file:\n\n```python\nimport os\nFIREBASE_KEY_FILE = os.path.join(BASE_DIR, 'path/to/firebase-credentials.json')\n```\n\n4. Add the authentication backend to `AUTHENTICATION_BACKENDS`:\n\n```python\nAUTHENTICATION_BACKENDS = ['firebase_auth.authentication.FirebaseAuthentication']\n```\n\n5. Add `firebase_auth` to `INSTALLED_APPS`:\n\n```python\nINSTALLED_APPS = [\n'firebase_auth',\n]\n```\n\n6. Add `FirebaseAuthMixin` to your `AUTH_USER_MODEL`:\n\n```python\nclass User(PermissionsMixin, FirebaseAuthMixin):\n```\n\n7. Build and run your DB migrations to add the changes:\n\n```sh\n./manage.py makemigrations\n./manage.py migrate\n```\n\n\n\n## Sending tokens on the client\n\nYour client will need to send an `Authorization: Bearer` token on each request. How you do this depends on your client\nand is outside the scope\nof this documentation.\n\n## Developing\n\n### Setting up your environment\n\n1. Install the dependencies:\n\n```sh\npipenv install -d\n```\n\n2. Download the JSON file from your [Firebase console](https://console.firebase.google.com/) with your account's\n   credentials.\n\n3. Create an `.env` file using `.env.example` as a template. Make sure\n   to specify the path to the file in the previous step.\n\n4. Enter the virtual environment:\n\n```sh\n./manage.py shell\n```\n\n### Other commands\n\n```sh\n# Run the tests\n./manage.py test\n```\n\n```sh\n# Lint the code\n./lint.sh\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Authentication provider for graphene-django and Google Firebase's Authentication service.",
    "version": "0.0.31",
    "project_urls": {
        "Homepage": "https://github.com/eba-alemayehu/graphene-django-firebase-auth"
    },
    "split_keywords": [
        "graphene",
        "django",
        "firebase",
        "auth"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a755fae0bf102c3c07ef6324cf00638e2dcc47ce9a2d2b7a478b9f5fc3c13875",
                "md5": "e0a381d23cbd093e6a43ff839a714870",
                "sha256": "83120f9dc0ec0d7771c83c830aef63e781b3591f2df7f83638d49493fe9e48f4"
            },
            "downloads": -1,
            "filename": "django_graphene_firebase_auth-0.0.31-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e0a381d23cbd093e6a43ff839a714870",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5769,
            "upload_time": "2024-04-27T08:22:17",
            "upload_time_iso_8601": "2024-04-27T08:22:17.604990Z",
            "url": "https://files.pythonhosted.org/packages/a7/55/fae0bf102c3c07ef6324cf00638e2dcc47ce9a2d2b7a478b9f5fc3c13875/django_graphene_firebase_auth-0.0.31-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7107b5bd93465278a74b00a7948d668a23d1d1d36b735675350c4dc454a5913",
                "md5": "7cb8d39034129dae7f4be45c688646e1",
                "sha256": "716548648f2a2514c2fce61352271c9fde64f42ebab371aa9f8c0fa190f66775"
            },
            "downloads": -1,
            "filename": "django_graphene_firebase_auth-0.0.31.tar.gz",
            "has_sig": false,
            "md5_digest": "7cb8d39034129dae7f4be45c688646e1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4647,
            "upload_time": "2024-04-27T08:22:22",
            "upload_time_iso_8601": "2024-04-27T08:22:22.889928Z",
            "url": "https://files.pythonhosted.org/packages/a7/10/7b5bd93465278a74b00a7948d668a23d1d1d36b735675350c4dc454a5913/django_graphene_firebase_auth-0.0.31.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-27 08:22:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eba-alemayehu",
    "github_project": "graphene-django-firebase-auth",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "django-graphene-firebase-auth"
}
        
Elapsed time: 0.26872s