public bool SubmitSecretQuestionAnswer([FromUrl] string token, SecretQuestionAnswer answer) { Context.WebContext.MarkConfidential(); var process = GetActiveProcess(token); if(process == null) return false; var storedAnswer = process.Login.SecretQuestionAnswers.FirstOrDefault(a => a.Question.Id == answer.QuestionId); Context.ThrowIfNull(storedAnswer, ClientFaultCodes.InvalidValue, "questionId", "Question is not registered user question."); var success = _processService.CheckSecretQuestionAnswer(process, storedAnswer.Question, answer.Answer); return success; }
public bool SubmitQuestionAnswer(string token, SecretQuestionAnswer answer) { Context.WebContext.MarkConfidential(); var session = Context.OpenSession(); var process = GetMutiFactorProcess(session, token); var storedAnswer = process.Login.SecretQuestionAnswers.FirstOrDefault(a => a.Question.Id == answer.QuestionId); Context.ThrowIfNull(storedAnswer, ClientFaultCodes.InvalidValue, "questionId", "Question is not registered user question."); var success = _processService.CheckSecretQuestionAnswer(process, storedAnswer.Question, answer.Answer); return(success); }