Skip to main content

Django Auth0 authentication background

Project description

https://codecov.io/gh/imanhodjaev/django-auth0/branch/master/graph/badge.svg Code Health https://travis-ci.org/imanhodjaev/django-auth0.png?branch=master

Django Auth0 authentication backend Backend implemented against Auth0 Regular Python application

Quickstart

  • Install django-auth0 $ pip install django-auth0

  • Add django_auth0 to INSTALLED_APPS

  • Add django_auth0.auth_backend.Auth0Backend to AUTHENTICATION_BACKENDS

  • Add django_auth0.context_processors.auth0 to CONTEXT_PROCESSORS so necessary template context will be provided

  • Include callback urls

Update AUTH0_CALLBACK_URL in settings.py to the following if want to use default authentication handler

  • Add Auth0 client side JavaScript and initialize it

Options:

  1. AUTH0_CLIENT_ID - Auth0 client app id,

  2. AUTH0_SECRET - Auth0 app secret,

  3. AUTH0_DOMAIN - Auth0 subdomain YOU_APP.auth0.com.

  4. AUTH0_CALLBACK_URL - Auth0 callback url is full url to your callback view like https://YOUR_DOMAIN/CALLBACK

  5. AUTH0_SUCCESS_URL - Url to redirect once you login successfully

Overriding callback view Default callback view looks like this so you can always write your own and set AUTH0_CALLBACK_URL to your custom view it should be url name.

Sample application is at https://github.com/imanhodjaev/auth0-sample

TODO

  • Improve tests,

  • Add Auth0 user profile model,

  • Add support for settings from Auth0,

  • Move string literals to configuration file

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements-test.txt
(myenv) $ python runtests.py

Credits

Tools used in rendering this package:

History

0.0.2 (2016-02-01)

  • Update documentation

0.0.1 (2016-02-01)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-auth0-0.0.3.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

django_auth0-0.0.3-py2.py3-none-any.whl (9.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-auth0-0.0.3.tar.gz.

File metadata

File hashes

Hashes for django-auth0-0.0.3.tar.gz
Algorithm Hash digest
SHA256 83f1415a7dabaa9a9b52154b2ca5a4c0e11cbb04772dd346ea5ed36a95088bbd
MD5 4d3dfcb3712933f674a1e6d73fd21cde
BLAKE2b-256 1f6fb17ce53618cc28404d06c759576e6ee0da481ba988bfeb94e2baf3016a3f

See more details on using hashes here.

File details

Details for the file django_auth0-0.0.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_auth0-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 029e1ea2d3a1696ec34aecb8d730af0a7960f734a6382768119452e1f783c50b
MD5 7d504d3df76442144b90f0c84b9720de
BLAKE2b-256 b872b9ec1605ba003da46e2b2b96e658ee45b05a8fb22ea3abb0152fdf3bc2de

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page