Only authenticating against LDAP

44 views
Skip to first unread message

Ian Stokes-Rees

unread,
Mar 11, 2011, 12:03:15 AM3/11/11
to django-a...@googlegroups.com
Hi, I have read about the

AUTH_LDAP_AUTHORIZE_ALL_USERS

option to configure auth-ldap, however what I'm really looking for is something that will only *authenticate* users through LDAP, rather than any password that may exist in the User object.  I want to have per-user authorization from Django, so I have:

AUTHENTICATION_BACKENDS = (
    'django_auth_ldap.backend.LDAPBackend',
    'django.contrib.auth.backends.ModelBackend',
)

but this seems to use ModelBackend for authentication if a user is not in LDAPBackend.

Ian

Peter Sagerson

unread,
Mar 11, 2011, 12:27:17 AM3/11/11
to django-a...@googlegroups.com
AUTH_LDAP_AUTHORIZE_ALL_USERS is only useful if you want to authenticate with something other than LDAP and then check LDAP for group membership and permissions. If you want to use LDAP exclusively, just remove ModelBackend from the list. Of course, this means that you can't assign per-user permissions or group membership by updating your local database. As far as I know, there's no way to tell ModelBackend to provide authorization without authentication. Although you could probably subclass it and stub out the authentication methods.

I'm a little fuzzy about what your question is, but if I didn't hit it, perhaps you could be specific about which backends you'd like to use for authentication and which for authorization.

Peter

Ian Stokes-Rees

unread,
Mar 11, 2011, 10:40:57 AM3/11/11
to django-a...@googlegroups.com, Peter Sagerson
Peter,

Thanks for this explanation -- it confirms what I understood to be the
case. I think the answer may be in suppressing the passwords in the
Django auth_users table (by corrupting them before saving the User object).

Ian

--
Ian Stokes-Rees, PhD W: http://hkl.hms.harvard.edu
ijst...@hkl.hms.harvard.edu T: +1 617 432-5608 x75
NEBioGrid, Harvard Medical School C: +1 617 331-5993


Di majo

unread,
May 12, 2024, 3:45:45 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