为什么websecurity.changepassword返回false? [英] Why does websecurity.changepassword return false?

查看:163
本文介绍了为什么websecurity.changepassword返回false?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WebSecurity.ChangePassword()方法返回false(即无法更改)。我提供了正确的参数(用户名,newPassword,confirmPassword)。



方法失败(返回false)。



检查成员资格数据库后,我正在尝试更改密码的帐户,'PasswordFailuresSinceLastSuccess'列每次尝试增加1。这看起来很奇怪



有没有人以前遇到过这个问题?



非常感谢提前。



我尝试过:



检查所有参数不为空

被检查用户未被锁定

WebSecurity.ChangePassword() method is returning false (i.e failing to change). I have provided the correct paramaters (username, newPassword, confirmPassword).

The method fails (returns false).

After checking the Membership Database, the account i'm trying to change the password of, the 'PasswordFailuresSinceLastSuccess' column increments by 1 on every attempt. This seems very odd

Has anyone ever experienced this problem before?

Many Thanks in advance.

What I have tried:

Checked all parameters aren't null
Checked user is not locked out

推荐答案

引用:

我提供了正确的参数(用户名,newPassword,confirmPassword)。

I have provided the correct paramaters (username, newPassword, confirmPassword).



根据文档 [ ^ ],参数为: username currentPassword newPassword



您需要将用户的当前密码作为第二个参数传递。您当前正在将用户的新密码作为第二个参数传递。由于新密码与当前密码不匹配,因此尝试更改密码失败。


According to the documentation[^], the parameters are: username, currentPassword, newPassword.

You need to pass the user's current password as the second parameter. You are currently passing the user's new password as the second parameter. Since the new password doesn't match the current password, the attempt to change the password fails.


这篇关于为什么websecurity.changepassword返回false?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆