rclsilver / django-lemonldap

Django application to make users to be authenticated through LemonLDAP::NG
Apache License 2.0
1 stars 4 forks source link

A tiny README might be helpful #4

Open dsanader opened 5 years ago

dsanader commented 5 years ago

Hello,

There's no really easy to find setup instructions for this package and by the way, the LemonLDAP::NG documentation refers to a non existing README.

It might be useful for potential users. ;)

A README possible content

What I've gathered, is I had to obviously install the package in the same environment as the Django app.

pip install django-lemonldap

And then add the required classes in AUTHENTICATIONS_BACKENDS and MIDDLEWARE configuration variables.

import lemonldap.auth
AUTHENTICATION_BACKENDS = [
    'lemonldap.auth.backends.LemonldapUserBackend',
]
MIDDLEWARE = (
    ...
    'lemonldap.auth.middleware.LemonldapAuthenticationMiddleware',
)

From the midlleware.py variable, I found out that I had to at least expose a Auth-User header for my Django app in the LemonLDAP::NG manager, and that other builtin variables were available (Mail, Superuser, Staff... etc.).

olivluca commented 3 years ago

Note that pipy has an outdated version missing commit e49333113517dba575a80cdc57b4432548b98efa so installing with "pip install" results in non working code.