Last post Jan 09, 2006 01:21 PM by thepichi
Jan 06, 2006 12:12 PM|thepichi|LINK
I've a web app with a login page, and I'm useing AD to validate users. My problem is I haven't found out how to get some properties using LDAP provider.
For example I want to know if an user as a temporary password ("User have to change password on next logon" property is checked in the user properties in win2003 server). Once I tried to log with this user I'm getting a "Bad username or password" exception,
because you have to change the password of course. My problem is, how can I get this property if I can't log in with in this user??.
Here is part of my code:
DirectoryEntry de =
DirectorySearcher search =
search.Filter = "(SAMAccountName=" + username + ")";
result = search.FindOne(); //I get an error here
I'd really appreciate any suggestion. Thanks in adavance.
Jan 06, 2006 02:38 PM|dunnry|LINK
Jan 06, 2006 02:45 PM|thepichi|LINK
Thanks for your response.
The problem is that if the user has a temprary password, the login procces fail, so when I try to do search.FindOne I got the error, and before that I can't access to any property, because I don't have a valid user object. That is my problem, that I don't
have a valid user in order to check that property.
Jan 06, 2006 03:05 PM|dunnry|LINK
Jan 09, 2006 01:21 PM|thepichi|LINK
Of course, that is the solution, I just used another user to authenticate.