private bool AuthPlain(string username, string password, XmppStream stream, UserManager userManager) { var user = userManager.GetUser(new Jid(username, stream.Domain, null)); if (user != null) { return string.Compare(user.Password, password, StringComparison.Ordinal) == 0; } return false; }
private bool AuthDigest(string username, string hash, XmppStream stream, UserManager userManager) { var user = userManager.GetUser(new Jid(username, stream.Domain, null)); if (user != null) { string serverhash = Hash.Sha1Hash(stream.Id + user.Password); return string.Compare(serverhash, hash, StringComparison.OrdinalIgnoreCase) == 0; } return false; }