caltechads / django-ldaporm

A Django ORM-like interface for ldap objectclasses
Other
9 stars 0 forks source link

Is there any runnable example or document? #1

Open safeblood opened 1 year ago

safeblood commented 1 year ago

Is there any runnable example or document?

ivanov17 commented 1 year ago

@cmalek @glennbach Sorry, are you planning to provide any documentation for this Django package?

I currently need a package that can use an LDAP directory as a database for my Django project. I was thinking about django-ldapdb, but its development has been slow lately.

What are your plans for this package? It looks like you are using this in production.

Thank you.

glennbach commented 1 year ago

Yes, we are using it in production in an enterprise setting, and plan to continue to use it. Development has been slow lately because it is working for our purposes. Documenting this module is unfortunately not a terribly high priority for us, but we could answer questions if you have them.

Glenn

On Oct 23, 2023, at 8:15 PM, anarchist Ivanov @.***> wrote:

@cmalek https://github.com/cmalek @glennbach https://github.com/glennbach Sorry, are you planning to provide any documentation for this Django package?

I currently need a package that can use an LDAP directory as a database for my Django project. I was thinking about django-ldapdb, but its development has been slow lately.

What are your plans for this package? It looks like you are using this in production.

Thank you.

— Reply to this email directly, view it on GitHub https://github.com/caltechads/django-ldaporm/issues/1#issuecomment-1776438023, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFMAUEAWREVOONF3UJDMJDYA4XERAVCNFSM6AAAAAAVZ27BCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZWGQZTQMBSGM. You are receiving this because you were mentioned.

ivanov17 commented 9 months ago

Hello, @glennbach!

Can you please tell me if there is any way to create a relationship between a class representing an LDAP entry and another class, such as a Django user?

In my application I also need to authenticate users using LDAP. I see that LdapManager provides authentication, but the database doesn't know anything about LDAP entries and I can't figure out how to associate the entry and the user. Could you help me please?

cmalek commented 9 months ago

This package is about treating LDAP as a database backend for Django, similar to the MySQL, Postgres, Oracle, etc. integrations. It provides models and managers to behave enough like the native Django SQL ORM that the Django forms and views etc. can work with them.

Authenticating an LDAP user to a Django user is a different problem that this code does not supply, because there are already packages for that. See https://django-auth-ldap.readthedocs.io/en/latest/

ivanov17 commented 9 months ago

Thank you very much, Chris. This clears things up.

I initially planned to use django-auth-ldap package to authenticate users, but then I noticed that LdapManager can also check authentication, and decided that it would be better to ask the authors of the package about its capabilities.

Your package works great with forms and views, I'm very happy with it. Thank you.

cmalek commented 9 months ago

Ah, I understand now. We have that authenticate() method on the manager class I added because in one of our use cases we can test passwords for a person. We have several different LDAP server clusters and sometimes we need to ensure that a user has the same password in all of them. For actual Django auth we use django-ldap-auth itself.