• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 957
  • Last Modified:

Active Directory

I need to write a login screen with validation by Active Directory but I am not sure how to do it. Would any kind experts please guide me how I can pass a userid and password to Active Directory to verify a user.

I've looked at a few sources such as:
http://www.agnisoft.com/white_papers/active_directory.asp

but I can't find anything on userid and password validation.

Thanks!
0
delphikit
Asked:
delphikit
  • 2
1 Solution
 
2266180Commented:
you could try and just log in using that user and pass. I took a look at the demo on that article and the button3 on bindigs demo does the job ;)
0
 
delphikitAuthor Commented:
Hi ciuly,

Thanks for pointing out the demo to me. I did played around with it. But why is it I can only verify my current user id and password and not others?

If I tried using other userid and password besides my own I get this error:

Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again.

If I tried using my own userid and password it shows me:
xxxDOMAIN,WinNT://xxxDOMAIN

I've changed the on click procedure to:

procedure TForm1.Button3Click(Sender: TObject);
var hr : integer;
    obj : IADs;
begin
  hr := ADsOpenObject('WinNT://' + DOMAINNAME, edUserID.text, edPassword.text,
           ADS_PROMPT_CREDENTIALS , IADs, obj );
  if Succeeded(hr) then
     ShowMessage(obj.Name + ',' + obj.ADsPath);
end;

Thanks.
0
 
2266180Commented:
that is some policy on your domain that restricts one user to one logon session. mine has something like if you miss the password the account is locked for some period of time. and of course that when I tested the code... I used a bad password so to see that indeed it worked. guess what happened when I tried to log on correctly :)
the best way to test such thing is using a test domain. those usually don't have much restrictions and you can do whatever you like. if you are in a software development company, then you must have some test domains (qa is usually using those)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now