473,395 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

using python_ldap for authentication

Hello all,

I'd like to use an ldap server just for authentication, but I'm a
complete beginner with all the ldap stuff...

I've tried this from the python_ldap Demo examples :

----------
import ldap, getpass

ldap_url="... validation ldap server URL & port ..."
l = ldap.initialize(ldap_url)

login_dn = "cn=thierry"
login_pw = getpass.getpass("Password for %s: " % login_dn)
l.simple_bind(login_dn, login_pw)
----------

but it seems to succeed whatever the password I'm providing :-(

How to simply assess the binding really occured ?
Do I need to start doing stuff with the "l" object to catch an error
and realize I'm not in fact connected : that's my current workaround
but I'm not very proud of it...

Thanks in advance !

Aug 31 '05 #1
1 1323
but it seems to succeed whatever the password I'm providing :-(

How to simply assess the binding really occured ? It should work...
If you are anxious have a look to your ldapserver logs, you can see the
bind . Try with an account that have modify rights et do a modify
request if it fails
you know there is a problem... Do I need to start doing stuff with the "l" object to catch an error
and realize I'm not in fact connected : that's my current workaround
but I'm not very proud of it...

Try:
Your code .... initialize
bind

except ldap.LDAPError,e:
.....
see
http://homepage.mac.com/mengelhart/p...p-samples.html
jmp

Sep 1 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
2
by: thechaosengine | last post by:
Hi eveyone, If anyone could advise on the following I would be truly greatful: I have a fairly standard set up. An IIS 5.1 website set up with anonymous access allowed in all areas of the site...
6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
20
by: Ramdas | last post by:
How do I add users using Python scripts on a Linux machine? Someone has a script?
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.