MVC认证流程查询

发布于 2024-10-12 13:13:37 字数 151 浏览 7 评论 0原文

我正在编写一个小应用程序,允许用户在线更新他们的个人信息。

我让他们在流程开始时进行身份验证,但在我将任何更改提交回数据库之前,我还想再次询问他们的密码。

这就是亚马逊在允许您查看购物篮和结账之前的工作方式。

有没有明智的方法来做到这一点?

I am writing a small app to allow users to update their personal information online.

I get them to Authenticate at the start of the process, but would like also to ask them again for their password just before I submit any changes back to the database.

This is the way Amazon works before allowing you to see your basket and checkout.

Is there a sensible way of doing this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

執念 2024-10-19 13:13:37

这取决于您作为会员提供者使用的内容...

假设您正在使用 System.Web.Security.MembershipProvider 那么您需要使用
ValidateUser 方法...

MembershipProvider _provider =  Membership.Provider;

if (_provider.ValidateUser(username,password)){


...the test has passed
}

我还假设 SSL 已到位...这将是一个很好的实践。

It kind of depends what your using as a membership provider...

Lets assume you are using System.Web.Security.MembershipProvider then you need to use the
ValidateUser method....

MembershipProvider _provider =  Membership.Provider;

if (_provider.ValidateUser(username,password)){


...the test has passed
}

I'm also assuming SSL is in place....which would be good practise.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文