no exception is raised when hitting LDAPError

24 views
Skip to first unread message

Theo Chatzimichos

unread,
May 9, 2013, 8:33:44 AM5/9/13
to django-a...@googlegroups.com
Hello,

I'm not sure if I am correct here, please let me know if I'm wrong. Looking at the code [1], there is no exception raised when it hits LDAPError. I'd like to know in my webapp if the connection to LDAP is working, otherwise let the user know with the appropriate error message, plus log the error (which is handled already) and send mail to the admins. Is this the desired behavior or a bug? And if it is designed like that intentionally, what's the reasoning behind that? I can easily do that in my login view by trying a simple bind before calling authenticate() if it is not supported by django-auth-ldap of course, but I'd like to clear this up on django-auth-ldap side first.

Theo

[1] https://bitbucket.org/psagers/django-auth-ldap/src/f9f5c3d95cdd3e2bfc3c224ad7d29ac79c089ed8/django_auth_ldap/backend.py?at=default#cl-325

Peter Sagerson

unread,
May 9, 2013, 12:14:38 PM5/9/13
to django-a...@googlegroups.com
It's true that we swallow LDAPErrors when authenticating. It's reasonable to have multiple authentication backends installed, so we try to be a good citizen and report failures without halting the entire authentication process. Someone using the built-in login view might well prefer an auth-failed result to a 500 page if there's a problem. This may be a case where one size doesn't fit all, of course. At the time, I chose to err on the side of not panicking if LDAP is unavailable and trying to soldier on. Sending mail to admins can obviously be arranged through the logging configuration.

We could probably add settings.AUTH_LDAP_RAISE_LDAP_ERRORS for those who are writing their own login views, have savvy users, and want more control.
> --
> You received this message because you are subscribed to the Google Groups "django-auth-ldap" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-auth-ld...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Di majo

unread,
May 12, 2024, 1:59:18 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