<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.11",
"maintainer_email": null,
"keywords": "google, django, sso",
"author": "Chris Maillefaud",
"author_email": "chrismaille@users.noreply.github.com",
"download_url": "https://files.pythonhosted.org/packages/78/11/3caca79adc78dd0cd4c5e10e9dbcb0f72ea0a4a704cf07a45439066a5f04/django_google_sso-8.0.0.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\nThis project is licensed under the terms of the MIT license.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Easily add Google Authentication to your Django Projects",
"version": "8.0.0",
"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": "e3e3d1e103ab160c385ae3fff96be1f4791f084c914a36d6233a42c9f3cfd4d8",
"md5": "84662644e3602678052b3e7484d6145f",
"sha256": "f50132b6fb1ee09acc6161b34f4ca6f9655294b16299296cc1cdcaa2cff8b09a"
},
"downloads": -1,
"filename": "django_google_sso-8.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "84662644e3602678052b3e7484d6145f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 23369,
"upload_time": "2024-10-09T15:21:32",
"upload_time_iso_8601": "2024-10-09T15:21:32.587870Z",
"url": "https://files.pythonhosted.org/packages/e3/e3/d1e103ab160c385ae3fff96be1f4791f084c914a36d6233a42c9f3cfd4d8/django_google_sso-8.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "78113caca79adc78dd0cd4c5e10e9dbcb0f72ea0a4a704cf07a45439066a5f04",
"md5": "a96518b1457013bfdabf3c3c6126c649",
"sha256": "26423a39d907546f91d3b06acbce698d8f80e1675c75d62cdf9d4ee2ec27c89c"
},
"downloads": -1,
"filename": "django_google_sso-8.0.0.tar.gz",
"has_sig": false,
"md5_digest": "a96518b1457013bfdabf3c3c6126c649",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 16835,
"upload_time": "2024-10-09T15:21:33",
"upload_time_iso_8601": "2024-10-09T15:21:33.636033Z",
"url": "https://files.pythonhosted.org/packages/78/11/3caca79adc78dd0cd4c5e10e9dbcb0f72ea0a4a704cf07a45439066a5f04/django_google_sso-8.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-09 15:21:33",
"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"
}