Skip to content

Delphi basic library for validation and authentication of LDAP users in Active Directory.

License

Notifications You must be signed in to change notification settings

EdZava/VCL-ActiveDirectory4Delphi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

demo

ActiveDirectory4Delphi

Version Twitter: ZavaDev

Delphi library (Basic) for validation and authentication of LDAP users in Active Directory

It also has an application to test the library with Active Directory.

✨ App Demo

Download

Example of use of the application and the information retrieved in the log.

demo

Get Current Info

Retrieve the information of the current section.

Sample Log:

AllProviders = WinNT:,LDAP:
CurrentUserName = usuario1
CurrentDomainName = MYDOMAIN
CurrentLDAPDomainName = DC=MYDOMAIN,DC=TEST
ActiveDirectoryEnabled = True

Get User Info

Retrieve user information using the domain and user indicated in the text boxes.

Sample Log:

Param.Domain = MYDOMAIN
Param.UserName = usuario1
UserFind = True
UserActive = True
UserInfo.UID = usuario1
UserInfo.UserName = usuario1
UserInfo.Description = Descripcion del usuario 1
UserInfo.Password.Expired = False
UserInfo.Password.NeverExpires = False
UserInfo.Password.CannotChange = False
UserInfo.Disabled = False
UserInfo.LockedOut = False
UserInfo.Groups = gusuarios,Usuarios del dominio

Authenticate

Authenticate using the domain and user indicated in the text boxes.

Sample Log:

Param.Domain = MYDOMAIN
Param.UserName = usuario1
Param.UserPass = *********
Authenticated = True

Example usage library

uses
  Common.ActiveDirectory.Utils;

...

// example authenticate current user
procedure Authenticate(UserPass: string);
var
  CurrentUserName: string;
  CurrentDomainName: string;
  CurrentLDAPDomainName: string;
begin
  if (not TActiveDirectoryUtils.GetActiveDirectoryEnabled) then
    Exit;

  CurrentUserName := TActiveDirectoryUtils.GetCurrentUserName;
  CurrentDomainName := TActiveDirectoryUtils.GetCurrentDomainName(CurrentUserName);  
  CurrentLDAPDomainName := TActiveDirectoryUtils.GetCurrentLDAPDomainName(CurrentDomainName);  

  if TActiveDirectoryUtils.AuthenticateUser(CurrentLDAPDomainName, CurrentUserName, UserPass) then
    ShowMessage('ok')
  else
    ShowMessage('Fail');
end;

// example validation user
procedure ValidationUserActive(DomainName, UserName: string);
begin
  if TActiveDirectoryUtils.GetUserActive(DomainName, UserName) then
    ShowMessage('ok')
  else
    ShowMessage('Fail');
end;

more information look at the unit Common.ActiveDirectory.Utils

Author

👤 Zava

Show your support

Give a ⭐️ if this project helped you!

About

Delphi basic library for validation and authentication of LDAP users in Active Directory.

Topics

Resources

License

Stars

Watchers

Forks

Languages