django-better-auth-oidc


Namedjango-better-auth-oidc JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/jouleworks/django-better-auth-oidc
SummaryBetter OpenID Connect authentication support for Django
upload_time2024-01-01 01:10:36
maintainer
docs_urlNone
authorJouleworks Development Contributors
requires_python
licenseMIT
keywords django auth oauth openid oidc social ldap
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Django-Better-Auth-OIDC - OpenID Connect authentication support for Django
==========================================================================

This is a Django login view that authenticates against an OpenID Connect
Authentication Server.

Use it if you own a single Authentication Server that you want to share
between multiple apps.

Huh?
----

This is a fork of the abandoned django-auth-oidc_. Original code by the Aiakos_ team.


What is OpenID Connect?
-----------------------

It's a OAuth2-based standard for authentication in applications.

It can be used for social logins, and for setting up Single Sign-On into multiple services
hosted by the same company. In the last case, it somewhat supersedes LDAP,
as with OIDC people are entering their credentials only into the views
served by the Authentication Server, and not into all the company's
applications.

Requirements
------------

- Python 3.5+
- Django 4.x+
- openid-connect_

Installation
------------

.. code:: python

	pip install django-better-auth-oidc

settings.py
~~~~~~~~~~~

.. code:: python

	INSTALLED_APPS += ['django_better_auth_oidc']

urls.py
~~~~~~~

.. code:: python

	urlpatterns += [
		path('auth/', include('django_better_auth_oidc.urls')),
	]

Configuration
-------------

Server Cache Lock
~~~~~~~~~~~~~~~~~
By default, DBAO will only fetch the server info based on a cache lock timer. To disable this feature, use the setting AUTH_SERVER_CACHE_LOCK and set to false.

Authorization Server
~~~~~~~~~~~~~~~~~~~~

App's redirect URI: http(s)://app-domain/auth/done
App's post-logout redirect URI: http(s)://app-domain/*LOGOUT_REDIRECT_URL* (or / if not set)

Authorization Server details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You may specify following settings in the Django settings file:

* AUTH_SERVER - OpenID Connect Authorization Server URL.
* AUTH_CLIENT_ID - Client ID received from the Authorization Server
* AUTH_CLIENT_SECRET - Client secret received from the Authorization Server
* AUTH_PROTOCOL (optional) - Legacy protocol supported by openid-connect_ library, for example github or gitlab. See openid-connect_'s documentation for full list of supported protocols.

Or, alternatively, you may set the AUTH_URL environment variable:

.. code:: bash

	AUTH_URL=(protocol+)http(s)://client_id:client_secret@server/

(Note: ":", "@", "/" and "%" inside client_id and client_secret must be urlquoted.)

Behavior
~~~~~~~~

* AUTH_SCOPE (default: ['openid']) - list of scopes to request from the auth server
* AUTH_GET_USER_FUNCTION (default: 'django_auth_oidc:get_user_by_username') - name of a function that takes the user info dict, and returns an user object representing that user; note that it should set the user.backend attribute.

.. _openid-connect: https://gitlab.com/aiakos/python-openid-connect
.. _Aiakos: https://gitlab.com/aiakos/aiakos
.. _django-auth-oidc: https://pypi.org/project/django-auth-oidc/

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jouleworks/django-better-auth-oidc",
    "name": "django-better-auth-oidc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "django auth oauth openid oidc social ldap",
    "author": "Jouleworks Development Contributors",
    "author_email": "hello@jouleworksdev.com",
    "download_url": "https://files.pythonhosted.org/packages/6c/e9/e7db74dd360cf53a5ab8f2a22827d433053340350a07845c9a889418757f/django-better-auth-oidc-0.2.0.tar.gz",
    "platform": null,
    "description": "Django-Better-Auth-OIDC - OpenID Connect authentication support for Django\n==========================================================================\n\nThis is a Django login view that authenticates against an OpenID Connect\nAuthentication Server.\n\nUse it if you own a single Authentication Server that you want to share\nbetween multiple apps.\n\nHuh?\n----\n\nThis is a fork of the abandoned django-auth-oidc_. Original code by the Aiakos_ team.\n\n\nWhat is OpenID Connect?\n-----------------------\n\nIt's a OAuth2-based standard for authentication in applications.\n\nIt can be used for social logins, and for setting up Single Sign-On into multiple services\nhosted by the same company. In the last case, it somewhat supersedes LDAP,\nas with OIDC people are entering their credentials only into the views\nserved by the Authentication Server, and not into all the company's\napplications.\n\nRequirements\n------------\n\n- Python 3.5+\n- Django 4.x+\n- openid-connect_\n\nInstallation\n------------\n\n.. code:: python\n\n\tpip install django-better-auth-oidc\n\nsettings.py\n~~~~~~~~~~~\n\n.. code:: python\n\n\tINSTALLED_APPS += ['django_better_auth_oidc']\n\nurls.py\n~~~~~~~\n\n.. code:: python\n\n\turlpatterns += [\n\t\tpath('auth/', include('django_better_auth_oidc.urls')),\n\t]\n\nConfiguration\n-------------\n\nServer Cache Lock\n~~~~~~~~~~~~~~~~~\nBy default, DBAO will only fetch the server info based on a cache lock timer. To disable this feature, use the setting AUTH_SERVER_CACHE_LOCK and set to false.\n\nAuthorization Server\n~~~~~~~~~~~~~~~~~~~~\n\nApp's redirect URI: http(s)://app-domain/auth/done\nApp's post-logout redirect URI: http(s)://app-domain/*LOGOUT_REDIRECT_URL* (or / if not set)\n\nAuthorization Server details\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYou may specify following settings in the Django settings file:\n\n* AUTH_SERVER - OpenID Connect Authorization Server URL.\n* AUTH_CLIENT_ID - Client ID received from the Authorization Server\n* AUTH_CLIENT_SECRET - Client secret received from the Authorization Server\n* AUTH_PROTOCOL (optional) - Legacy protocol supported by openid-connect_ library, for example github or gitlab. See openid-connect_'s documentation for full list of supported protocols.\n\nOr, alternatively, you may set the AUTH_URL environment variable:\n\n.. code:: bash\n\n\tAUTH_URL=(protocol+)http(s)://client_id:client_secret@server/\n\n(Note: \":\", \"@\", \"/\" and \"%\" inside client_id and client_secret must be urlquoted.)\n\nBehavior\n~~~~~~~~\n\n* AUTH_SCOPE (default: ['openid']) - list of scopes to request from the auth server\n* AUTH_GET_USER_FUNCTION (default: 'django_auth_oidc:get_user_by_username') - name of a function that takes the user info dict, and returns an user object representing that user; note that it should set the user.backend attribute.\n\n.. _openid-connect: https://gitlab.com/aiakos/python-openid-connect\n.. _Aiakos: https://gitlab.com/aiakos/aiakos\n.. _django-auth-oidc: https://pypi.org/project/django-auth-oidc/\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Better OpenID Connect authentication support for Django",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/jouleworks/django-better-auth-oidc"
    },
    "split_keywords": [
        "django",
        "auth",
        "oauth",
        "openid",
        "oidc",
        "social",
        "ldap"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "baa198ab7cf3ca958d95d4712a447b88aa5192f94bd298d8574373fb21827620",
                "md5": "282851df8bc3ced85c7c91881166283f",
                "sha256": "f020b47f8a59fa8a5157df3a0280e2a351ad7d793e91a549516ece57d0c44c44"
            },
            "downloads": -1,
            "filename": "django_better_auth_oidc-0.2.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "282851df8bc3ced85c7c91881166283f",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 8014,
            "upload_time": "2024-01-01T01:10:35",
            "upload_time_iso_8601": "2024-01-01T01:10:35.637694Z",
            "url": "https://files.pythonhosted.org/packages/ba/a1/98ab7cf3ca958d95d4712a447b88aa5192f94bd298d8574373fb21827620/django_better_auth_oidc-0.2.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6ce9e7db74dd360cf53a5ab8f2a22827d433053340350a07845c9a889418757f",
                "md5": "80fb9141cbc4084d24869c4eaf0fbe28",
                "sha256": "f591e0dc3f67ab7b09e7a715fa8d29b2150bc0fb1f0e544d5711c30f5ddf803c"
            },
            "downloads": -1,
            "filename": "django-better-auth-oidc-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "80fb9141cbc4084d24869c4eaf0fbe28",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5704,
            "upload_time": "2024-01-01T01:10:36",
            "upload_time_iso_8601": "2024-01-01T01:10:36.822954Z",
            "url": "https://files.pythonhosted.org/packages/6c/e9/e7db74dd360cf53a5ab8f2a22827d433053340350a07845c9a889418757f/django-better-auth-oidc-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-01 01:10:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jouleworks",
    "github_project": "django-better-auth-oidc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "django-better-auth-oidc"
}
        
Elapsed time: 0.17104s