Example project

164 views
Skip to first unread message

Adrien Lemaire

unread,
Oct 10, 2011, 11:21:55 PM10/10/11
to django-auth-ldap
Hi guys,

can someone push a "example" directory on https://bitbucket.org/psagers/django-auth-ldap/src
, which would be a basic project with a simple app, eg a login form
and a DetailView filled from the ldap server ?

That would help new users with limited ldap knowledge like me :)

Thanks a lot

Adrien Lemaire

unread,
Oct 11, 2011, 3:42:58 AM10/11/11
to django-auth-ldap
That's weird ... After a long debugging as I couldn't get django-auth-
ldap to authenticate, I realized that the AUTH_LDAP_BIND_DN is totally
different with called in self._bind_as(self.dn, password).

I get a self.dn = 'cn=cn\\=admin\\,dc\\=name\\,dc\\=org' when
AUTH_LDAP_BIND_DN = 'cn=admin,dc=name,dc=org'.
Means that I shouldn't write the "cn=" as it's auto prefixed (and the
example in http://packages.python.org/django-auth-ldap/#auth-ldap-connection-options
is with a "cn="). For the \\ appended before the =, I still don't know
what to do... seems that in backend.py, we should call
django_auth_ldap.dn in config.py line 62.

I've got python 2.7.2, ldap 2.4.3, django_auth_ldap 1.0.12

I'm a bit lost here ... doesn't seem to work. Any help is appreciated,
thanks in advance !


On Oct 11, 12:21 pm, Adrien Lemaire <lemaire.adr...@gmail.com> wrote:
> Hi guys,
>
> can someone push a "example" directory onhttps://bitbucket.org/psagers/django-auth-ldap/src

Peter Sagerson

unread,
Oct 12, 2011, 1:08:34 PM10/12/11
to django-a...@googlegroups.com
self.dn is the DN that gets constructed from a username. It looks like you're typing in a whole DN to log in, which isn't the intention. Django auth is based on usernames, so the idea is that you type in a username, LDAPBackend uses AUTH_LDAP_USER_DN_TEMPLATE (or AUTH_LDAP_USER_SEARCH et all) to construct a DN, and authenticates against LDAP with that.

So if you want to authenticate to LDAP as cn=admin,dc=name,dc=org, you would presumably set AUTH_LDAP_USER_DN_TEMPLATE to "cn=%(user)s,dc=name,dc=org" and then log in as admin. If this succeeds, you will now have a django.contrib.auth.models.User object with a username of "admin".

Di majo

unread,
May 12, 2024, 3:20:32 PM5/12/24
to django-auth-ldap
MT103/202 DIRECT WIRE TRANSFER
PAYPAL TRANSFER
CASHAPP TRANSFER
ZELLE TRANSFER
LOAN DEAL
TRANSFER WISE
WESTERN UNION TRANSFER
BITCOIN FLASHING
BANK ACCOUNT LOADING/FLASHING
IBAN TO IBAN TRANSFER
MONEYGRAM TRANSFER
IPIP/DTC
SLBC PROVIDER
CREDIT CARD TOP UP
DUMPS/ PINS
SEPA TRANSFER
WIRE TRANSFER
BITCOIN TOP UP
GLOBALPAY INC US
SKRILL USA
UNIONPAY RECEIVER

Thanks.


NOTE; ONLY SERIOUS / RELIABLE RECEIVERS CAN CONTACT.

DM ME ON WHATSAPP
+44 7529 555638

Reply all
Reply to author
Forward
0 new messages