Exemplo n.º 1
0
 public bool CheckSecretQuestionAnswer(ISecretQuestionAnswer storedAnswer, string answer)
 {
     Util.Check(storedAnswer != null, "Stored answer may not be null");
       var hash = GetWeakSecretAnswerHash(answer, storedAnswer.Login.Id);
       if(hash == storedAnswer.AnswerHash)
     return true;
       var session = EntityHelper.GetSession(storedAnswer);
       OnLoginEvent(session.Context, LoginEventType.QuestionAnswersFailed, storedAnswer.Login, "Question #" + storedAnswer.Number);
       return false;
 }
Exemplo n.º 2
0
        public bool CheckSecretQuestionAnswer(ISecretQuestionAnswer storedAnswer, string answer)
        {
            Util.Check(storedAnswer != null, "Stored answer may not be null");
            var hash = GetWeakSecretAnswerHash(answer, storedAnswer.Login.Id);

            if (hash == storedAnswer.AnswerHash)
            {
                return(true);
            }
            var session = EntityHelper.GetSession(storedAnswer);

            OnLoginEvent(session.Context, LoginEventType.QuestionAnswersFailed, storedAnswer.Login, "Question #" + storedAnswer.Number);
            return(false);
        }
Exemplo n.º 3
0
 private bool CheckUserAnswer(ISecretQuestionAnswer storedAnswer, string userAnswer)
 {
     var ahash = GetWeakSecretAnswerHash(userAnswer, storedAnswer.Login.Id);
       return ahash == storedAnswer.AnswerHash;
 }
Exemplo n.º 4
0
        private bool CheckUserAnswer(ISecretQuestionAnswer storedAnswer, string userAnswer)
        {
            var ahash = GetWeakSecretAnswerHash(userAnswer, storedAnswer.Login.Id);

            return(ahash == storedAnswer.AnswerHash);
        }