Code Monkey home page Code Monkey logo

django-auth0's Introduction

django-auth0

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:

django-auth0's People

Contributors

bzdk avatar peterbe avatar sultaniman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.