/// <summary>
 ///     Authenticates the user
 /// </summary>
 /// <param name="directoryEntry"></param>
 /// <param name="username"></param>
 /// <param name="password"></param>
 internal Uid Authenticate(/*DirectoryEntry directoryEntry,*/ string username,
     Org.IdentityConnectors.Common.Security.GuardedString password, bool returnUidOnly)
 {
     AuthenticationHelper authHelper = new AuthenticationHelper(_configuration);
     if(returnUidOnly)
     {
         return authHelper.GetUidFromSamAccountName(username);
     }
     password.Access(setCurrentPassword);
     return authHelper.ValidateUserCredentials(username, _currentPassword);
 }
 /// <summary>
 ///     Authenticates the user
 /// </summary>
 /// <param name="username"></param>
 /// <param name="password"></param>
 /// <param name="returnUidOnly"></param>
 internal Uid Authenticate(/*DirectoryEntry directoryEntry,*/ string username,
     GuardedString password, bool returnUidOnly)
 {
     AuthenticationHelper authHelper = new AuthenticationHelper(_configuration);
     if(returnUidOnly)
     {
         return authHelper.GetUidFromSamAccountName(username);
     }
     _currentPassword = SecurityUtil.Decrypt(password);
     return authHelper.ValidateUserCredentials(username, _currentPassword);
 }