django-google-sso


Namedjango-google-sso JSON
Version 6.1.1 PyPI version JSON
download
home_pagehttps://github.com/megalus/django-google-sso
SummaryEasily add Google Authentication to your Django Projects
upload_time2024-04-09 19:46:44
maintainerNone
docs_urlNone
authorChris Maillefaud
requires_python<4.0,>=3.10
licenseMIT
keywords google django sso
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <img src="docs/images/django-google-sso.png" alt="Django Google SSO"/>
</p>
<p align="center">
<em>Easily integrate Google Authentication into your Django projects</em>
</p>

<p align="center">
<a href="https://pypi.org/project/django-google-sso/" target="_blank">
<img alt="PyPI" src="https://img.shields.io/pypi/v/django-google-sso"/></a>
<a href="https://github.com/megalus/django-google-sso/actions" target="_blank">
<img alt="Build" src="https://github.com/megalus/django-google-sso/workflows/tests/badge.svg"/>
</a>
<a href="https://www.python.org" target="_blank">
<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/django-google-sso"/>
</a>
<a href="https://www.djangoproject.com/" target="_blank">
<img alt="PyPI - Django Version" src="https://img.shields.io/pypi/djversions/django-google-sso"/>
</a>
</p>

## Welcome to Django Google SSO

This library aims to simplify the process of authenticating users with Google in Django Admin pages,
inspired by libraries like [django_microsoft_auth](https://github.com/AngellusMortis/django_microsoft_auth)
and [django-admin-sso](https://github.com/matthiask/django-admin-sso/)

---

### Documentation

* Docs: https://megalus.github.io/django-google-sso/

---

### Install

```shell
$ pip install django-google-sso
```

### Configure

1. Add the following to your `settings.py` `INSTALLED_APPS`:

```python
# settings.py

INSTALLED_APPS = [
    # other django apps
    "django.contrib.messages",  # Need for Auth messages
    "django_google_sso",  # Add django_google_sso
]
```

2. In [Google Console](https://console.cloud.google.com/apis/credentials) at _Api -> Credentials_, retrieve your
   Project Credentials and add them in your `settings.py`:

```python
# settings.py

GOOGLE_SSO_CLIENT_ID = "your client id here"
GOOGLE_SSO_PROJECT_ID = "your project id here"
GOOGLE_SSO_CLIENT_SECRET = "your client secret here"
```

3. Add the callback uri `http://localhost:8000/google_sso/callback/` in your Google Console, on the "Authorized Redirect
   URL".

4. Let Django Google SSO auto create users for allowable domains:

```python
# settings.py

GOOGLE_SSO_ALLOWABLE_DOMAINS = ["example.com"]
```

5. In `urls.py` please add the **Django-Google-SSO** views:

```python
# urls.py

from django.urls import include, path

urlpatterns = [
    # other urlpatterns...
    path(
        "google_sso/", include("django_google_sso.urls", namespace="django_google_sso")
    ),
]
```

6. And run migrations:

```shell
$ python manage.py migrate
```

That's it. Start django on port 8000 and open your browser in `http://localhost:8000/admin/login` and you should see the
Google SSO button.

<p align="center">
   <img src="docs/images/django_login_with_google_light.png"/>
</p>

---

## License

This project is licensed under the terms of the MIT license.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/megalus/django-google-sso",
    "name": "django-google-sso",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "google, django, sso",
    "author": "Chris Maillefaud",
    "author_email": "chrismaille@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/91/86/5185d6e71036cc2fdf2b373eb825f7ceb7d2a25ec6152594c7ec6b02b876/django_google_sso-6.1.1.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <img src=\"docs/images/django-google-sso.png\" alt=\"Django Google SSO\"/>\n</p>\n<p align=\"center\">\n<em>Easily integrate Google Authentication into your Django projects</em>\n</p>\n\n<p align=\"center\">\n<a href=\"https://pypi.org/project/django-google-sso/\" target=\"_blank\">\n<img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/django-google-sso\"/></a>\n<a href=\"https://github.com/megalus/django-google-sso/actions\" target=\"_blank\">\n<img alt=\"Build\" src=\"https://github.com/megalus/django-google-sso/workflows/tests/badge.svg\"/>\n</a>\n<a href=\"https://www.python.org\" target=\"_blank\">\n<img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/django-google-sso\"/>\n</a>\n<a href=\"https://www.djangoproject.com/\" target=\"_blank\">\n<img alt=\"PyPI - Django Version\" src=\"https://img.shields.io/pypi/djversions/django-google-sso\"/>\n</a>\n</p>\n\n## Welcome to Django Google SSO\n\nThis library aims to simplify the process of authenticating users with Google in Django Admin pages,\ninspired by libraries like [django_microsoft_auth](https://github.com/AngellusMortis/django_microsoft_auth)\nand [django-admin-sso](https://github.com/matthiask/django-admin-sso/)\n\n---\n\n### Documentation\n\n* Docs: https://megalus.github.io/django-google-sso/\n\n---\n\n### Install\n\n```shell\n$ pip install django-google-sso\n```\n\n### Configure\n\n1. Add the following to your `settings.py` `INSTALLED_APPS`:\n\n```python\n# settings.py\n\nINSTALLED_APPS = [\n    # other django apps\n    \"django.contrib.messages\",  # Need for Auth messages\n    \"django_google_sso\",  # Add django_google_sso\n]\n```\n\n2. In [Google Console](https://console.cloud.google.com/apis/credentials) at _Api -> Credentials_, retrieve your\n   Project Credentials and add them in your `settings.py`:\n\n```python\n# settings.py\n\nGOOGLE_SSO_CLIENT_ID = \"your client id here\"\nGOOGLE_SSO_PROJECT_ID = \"your project id here\"\nGOOGLE_SSO_CLIENT_SECRET = \"your client secret here\"\n```\n\n3. Add the callback uri `http://localhost:8000/google_sso/callback/` in your Google Console, on the \"Authorized Redirect\n   URL\".\n\n4. Let Django Google SSO auto create users for allowable domains:\n\n```python\n# settings.py\n\nGOOGLE_SSO_ALLOWABLE_DOMAINS = [\"example.com\"]\n```\n\n5. In `urls.py` please add the **Django-Google-SSO** views:\n\n```python\n# urls.py\n\nfrom django.urls import include, path\n\nurlpatterns = [\n    # other urlpatterns...\n    path(\n        \"google_sso/\", include(\"django_google_sso.urls\", namespace=\"django_google_sso\")\n    ),\n]\n```\n\n6. And run migrations:\n\n```shell\n$ python manage.py migrate\n```\n\nThat's it. Start django on port 8000 and open your browser in `http://localhost:8000/admin/login` and you should see the\nGoogle SSO button.\n\n<p align=\"center\">\n   <img src=\"docs/images/django_login_with_google_light.png\"/>\n</p>\n\n---\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Easily add Google Authentication to your Django Projects",
    "version": "6.1.1",
    "project_urls": {
        "Homepage": "https://github.com/megalus/django-google-sso",
        "Repository": "https://github.com/megalus/django-google-sso"
    },
    "split_keywords": [
        "google",
        " django",
        " sso"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "32a4a06be30d3b7cf237abe9e66082401bd1267ad6760f4e786c9eb2b921e7f6",
                "md5": "ee9699fab6cf59f13c1ad136d485fdaa",
                "sha256": "8b59b13051e3aab1687759e9f2dfed4f52f780e7b29a6676ae8f1686ffceb63c"
            },
            "downloads": -1,
            "filename": "django_google_sso-6.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ee9699fab6cf59f13c1ad136d485fdaa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 21714,
            "upload_time": "2024-04-09T19:46:43",
            "upload_time_iso_8601": "2024-04-09T19:46:43.808048Z",
            "url": "https://files.pythonhosted.org/packages/32/a4/a06be30d3b7cf237abe9e66082401bd1267ad6760f4e786c9eb2b921e7f6/django_google_sso-6.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91865185d6e71036cc2fdf2b373eb825f7ceb7d2a25ec6152594c7ec6b02b876",
                "md5": "a039ca2769f9b4f7dc59243eebdcb389",
                "sha256": "5ba49d083b1e4cd1c28c607a48cd04b67c92689b808782264ef48db2dd8a6b4f"
            },
            "downloads": -1,
            "filename": "django_google_sso-6.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a039ca2769f9b4f7dc59243eebdcb389",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 15528,
            "upload_time": "2024-04-09T19:46:44",
            "upload_time_iso_8601": "2024-04-09T19:46:44.879227Z",
            "url": "https://files.pythonhosted.org/packages/91/86/5185d6e71036cc2fdf2b373eb825f7ceb7d2a25ec6152594c7ec6b02b876/django_google_sso-6.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-09 19:46:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "megalus",
    "github_project": "django-google-sso",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "django-google-sso"
}
        
Elapsed time: 0.23305s