authentication by ldap server

31 views
Skip to first unread message

pacopyc pacopyc

unread,
Dec 1, 2017, 7:20:45 AM12/1/17
to Django users

Hi, I am a beginner django programmer.


I would like to authenticate users of my web application to an ldap server (which has about 1000 users defined).


Not all users of the ldap server must be able to access the web application (only 50 ldap users must have access to the web application).


First problem: I can not authenticate users on ldap server. I referred to https://django-auth-ldap.readthedocs.io/en/latest/ and some articles on the Internet. Do you have any simple examples? I just want to check username and password


Second issue: Once the user has been authenticated on the ldap server, I must verify that he can access the web application. How can I do? Do I have to define it on Django too? How?


Third issue: Web application users must have different permissions in using the application. Permissions are defined on Django. How can I link 50 ldap users to these permissions?


Thanks

pacopyc

Mario Gudelj

unread,
Dec 1, 2017, 6:02:15 PM12/1/17
to django...@googlegroups.com
You should use django-auth-ldap. It will give you the ability to bind ldap attributes with the attributes from your user model using a dict inside settings. It’ll also get the users’ groups and create those groups inside Django. So try plugging that in and come back if you get stuck. All you really need to define is the server IP or URL, bind username and password if required, a common DN and those aforementioned attributes and groups. Then once you specify the ldap middleware you can use Django’s authentication mechanism. 

Cheers,

M

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ceb285c5-1d7b-4412-ad77-7425ae499dfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages