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.
Example of use of the application and the information retrieved in the log.
Retrieve the information of the current section.
Sample Log:
AllProviders = WinNT:,LDAP:
CurrentUserName = usuario1
CurrentDomainName = MYDOMAIN
CurrentLDAPDomainName = DC=MYDOMAIN,DC=TEST
ActiveDirectoryEnabled = True
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 using the domain and user indicated in the text boxes.
Sample Log:
Param.Domain = MYDOMAIN
Param.UserName = usuario1
Param.UserPass = *********
Authenticated = True
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
👤 Zava
- Twitter: @ZavaDev
Give a ⭐️ if this project helped you!