예제 #1
0
        protected void ibtnContinue_Click(object sender, ImageClickEventArgs e)
        {
            if (ViewState["IsLock"] != null)
            {
                if (ViewState["IsLock"].ToString().Equals("false"))
                {
                    if (dtQues == null)
                    {
                        dtQues = (DataTable)ViewState["Ques"];
                    }

                    CryptographyService cryptographyService = new PasswordCryptographyService();
                    string answer = cryptographyService.Decrypt(dtQues.Rows[0]["Answer"].ToString());

                    var objUser = new UserDAL();
                    objUser.SaveClient(IpAddress(), "UserId");

                    if (!answer.ToLower().Equals(txtAnswer.Text.ToLower()))
                    {
                        divError.Visible   = true;
                        divError.InnerText = "Answer of Security question is not correct.";
                    }
                    else
                    {
                        if (Request.QueryString["Action"] != null)
                        {
                            if (Request.QueryString["Action"] == "Password")
                            {
                                Response.RedirectUser("./ResetPasswordStep3.aspx?Action=Password");
                            }
                            else if (Request.QueryString["Action"] == "Username")
                            {
                                Response.RedirectUser("./ResetPasswordStep3.aspx?Action=CustomerId");
                            }
                        }
                    }
                }
            }
        }
예제 #2
0
 public void SetUp()
 {
     _passwordCryptographyService = new PasswordCryptographyService();
 }
        public PasswordCryptographyServiceTests()
        {
            var identityHasher = new PasswordHasher <PasswordHasherUser>();

            _passwordCryptographyService = new PasswordCryptographyService(identityHasher);
        }