MVC 3 应用程序的用户/PW 系统

发布于 2024-12-03 23:18:04 字数 329 浏览 1 评论 0原文

所以我读过很多关于网络应用程序密码系统的文章,它们看起来都非常令人困惑。有人说你需要对你的 PW 进行哈希处理并建立 https 安全连接,其他人则说你只需要对你的 PW 进行哈希处理并加盐。

我只知道,在执行了数百万次之后,可能有某种库可以为我在客户端输入的密码做很多事情,并为我提供一些安全保存在我的 SQL Server 中的内容2008年数据库。

我需要担心所有 https 安全连接的问题吗?我可以确保我正确地散列密码吗?为了散列它,我是否需要任何外部库,或者我可以完全在 .NET 中创建一个安全的用户/密码系统吗?

我以前从未这样做过,所以任何文章、提示、链接都会非常有帮助。谢谢。

So I've read numerous articles on a password system for a web app, and they all seem very confusing. Some say you need to hash your PW's AND establish an https secure connection, others say you just need to hash AND salt your PW's.

I just know, after this has been done millions of times, there's PROBABLY some sort of library out there that can do a bunch of things for me for a password inputted on a client side, and give me something to save securely in my SQL Server 2008 database.

Do I need to worry about all the https secure connection stuff? Can I just make sure I hash the PW correctly? To hash it, do I need any external libraries or can I create a secure user/pw system entirely in .NET?

I've never done this before so any articles, tips, links would be very helpful. Thanks.

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

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

发布评论

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

评论(2

捶死心动 2024-12-10 23:18:04

如果您不想自己动手,可以随时使用 ASP.Net 会员资格

ASP.NET 成员资格为您提供了一种验证和存储用户凭据的内置方法。因此,ASP.NET 成员身份可帮助您管理网站中的用户身份验证。您可以将 ASP.NET 成员身份与 ASP.NET 表单身份验证结合使用,方法是与 ASP.NET 登录控件结合使用,创建一个完整的用户身份验证系统。

ASP.NET 会员资格支持以下功能:

  • 创建新用户和密码。

  • 将成员资格信息(用户名、密码和支持数据)存储在 Microsoft SQL Server、Active Directory 或替代数据存储中。

  • 对访问您网站的用户进行身份验证。您可以通过编程方式对用户进行身份验证,也可以使用 ASP.NET 登录控件创建一个需要很少代码或不需要代码的完整身份验证系统。

  • 管理密码,包括创建、更改和重置密码。根据您选择的会员选项,会员系统还可以提供自动密码重置系统,该系统接受用户提供的问题和回答。

  • 公开经过身份验证的用户的唯一标识,您可以在自己的应用程序中使用该标识,并且还可以与 ASP.NET 个性化和角色管理(授权)系统集成。

  • 指定自定义成员资格提供程序,它允许您替换自己的代码来管理成员资格并在自定义数据存储中维护成员资格数据


配置 ASP.NET 应用程序以使用成员身份


github 上还有一个项目,名为 MVC 会员入门工具包

If you don't want to roll your own you can always use ASP.Net Membership

ASP.NET membership gives you a built-in way to validate and store user credentials. ASP.NET membership therefore helps you manage user authentication in your Web sites. You can use ASP.NET membership with ASP.NET forms authentication by using with the ASP.NET login controls to create a complete system for authenticating users.

ASP.NET membership supports facilities for:

  • Creating new users and passwords.

  • Storing membership information (user names, passwords, and supporting data) in Microsoft SQL Server, Active Directory, or an alternative data store.

  • Authenticating users who visit your site. You can authenticate users programmatically, or you can use the ASP.NET login controls to create a complete authentication system that requires little or no code.

  • Managing passwords, which includes creating, changing, and resetting them . Depending on membership options you choose, the membership system can also provide an automated password-reset system that takes a user-supplied question and response.

  • Exposing a unique identification for authenticated users that you can use in your own applications and that also integrates with the ASP.NET personalization and role-management (authorization) systems.

  • Specifying a custom membership provider, which allows you to substitute your own code to manage membership and maintain membership data in a custom data store


Configuring an ASP.NET Application to Use Membership


There's also a project on github called Membership Starter Kit for MVC

向日葵 2024-12-10 23:18:04

默认的 MVC3 Internet 应用程序模板(文件新项目)已为您提供了此设置,只需将 [Authorize()] 添加到您想要保护的控制器/方法即可。不要推出新的东西,使用现有的东西。此外,请使用 SSL,因为有人可以通过嗅探流量并简单地使用您的 cookie 轻松窃取会话。就是这么简单。

The default MVC3 Internet Application template (file-new project) has this setup for you already, simply add [Authorize()] to the controllers/methods you want to protect. Don't roll something new, use what's there for you. In addition, please use SSL as someone can easily steal a session by sniffing traffic and simply using your cookie. It's that easy.

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