Coder Social home page Coder Social logo

django-pam's Introduction

django-pam

A simple PAM authentication backend for Django. Add the folder dpam somewhere on your python path and add 'dpam.backends.PAMBackend' to your settings.py:

AUTHENTICATION_BACKENDS = (
    ...
    'dpam.backends.PAMBackend',
    ...
)

Now you can login via the system-login credentials. If the user is successfully authenticated but has never logged-in before, a new User object is created. By default this new User has both is_staff and is_superuser set to False. You can change this behavior by adding PAM_IS_STAFF=True and PAM_IS_SUPERUSER in your settings.py file.

If you do not want a User record to be created automatically, use PAM_CREATE_USER=False in settings.py. This is useful in situations where you want to use PAM for authentication but not for authorization.

django-pam's People

Contributors

ftao avatar justinazoff avatar kingb avatar tehmaze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-pam's Issues

Unable to login using Ubuntu Users

Hi,

I installed package 'django-pam' using 'python setup.py install', the installation was successful. I added the entry in setting.py (fresh django 1.8.x installation) as below. After that I restarted django server and tried to login into http://admin url page. It was taking some time to reload but the LOGIN FAILED. Moreover, the Django superuser was unable to login into admin. I removed below entry from setting.py and the superuser was able to login. Please help me integrating this package.

setting.py:

AUTHENTICATION_BACKENDS = (
'dpam.backends.PAMBackend',
)
PAM_IS_STAFF = True
PAM_IS_SUPERUSER = True

Does this only work if Django is running as root?

Based on problems I am having, and comments like this one, it seems that this might be the case, but django doesn't typically run as root and the docs for this app don't mention requiring it to do so. If someone could provide a quick sanity-check about this I would appreciate it.

For details on what I'm seeing, see this issue I filed against python-pam, which seems to be the same pam module that runs under the hood of django-pam. Any help would be greatly appreciated!

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.