public override bool ValidateUser(string username, string password)
 {
     try
     {
         return(KbVaultAuthHelper.ValidateUser(username, password));
     }
     catch (Exception ex)
     {
         log.Error(ex);
         throw;
     }
 }
Пример #2
0
 public override bool IsUserInRole(string username, string roleName)
 {
     try
     {
         KbUser usr = KbVaultAuthHelper.GetKbUser(username);
         if (usr == null)
         {
             return(false);
         }
         return(usr.Role == roleName);
     } catch (Exception ex)
     {
         Log.Error(ex);
         throw;
     }
 }
Пример #3
0
 public override string[] GetRolesForUser(string username)
 {
     try
     {
         KbUser usr = KbVaultAuthHelper.GetKbUser(username);
         if (usr == null)
         {
             throw new ArgumentOutOfRangeException(username + " not found");
         }
         return(new string[] { usr.Role });
     } catch (Exception ex)
     {
         Log.Error(ex);
         throw;
     }
 }
 public override bool ChangePassword(string username, string oldPassword, string newPassword)
 {
     try
     {
         KbVaultAuthHelper.ChangePassword(username, oldPassword, newPassword);
         return(true);
     }
     catch (InvalidPasswordException)
     {
         return(false);
     }
     catch (Exception ex)
     {
         log.Error(ex);
         throw;
     }
 }