ASP.NET MVC 使用验证码注册

发布于 2024-09-11 13:00:45 字数 234 浏览 0 评论 0原文

我想允许我的用户通过输入姓名、电子邮件和密码信息从主页注册。提交表单后,我想将用户重定向到安全检查页面以进行 capthca 验证。验证码验证后,用户将被保存到数据库中。该场景类似于Facebook的主页注册功能。

我的问题是,在收集姓名、电子邮件和密码信息后,如何以安全的方式将它们发送到验证码验证页面(不使用查询字符串发送它们,因为密码在那里很简单)。本项目中不会遵循TempData和Session的使用。

谢谢你!

I would like to allow my users to register from homepage by entering name, surname, email and password information. After submitting the form, I want to redirect my users to a security check page for a capthca validation. User will be saved to the database after this captcha validation. The scenario is similar to Facebook's homepage registration feature.

My problem is, after collecting name, surname, email and password information how can I send them to the captcha validation page in a secure manner (not sending them with querystring, because password will be plain there). TempData and Session usage will not be followed in this project.

Thank you!

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

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

发布评论

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

评论(2

亣腦蒛氧 2024-09-18 13:00:45

首先,您可以使用 Recaptcha for .NET (http://recaptchanet.codeplex.com) 来使用适用于您的 MVC .NET 项目的强大且安全的验证码解决方案。

当您提交表单时,创建一个 cookie 并使用用户的会话 ID 作为密钥对其值进行加密,并将其过期时间设置为 5 分钟左右。从验证码页面读取 cookie。我假设您不想将值存储在服务器上,并且查询字符串显然是不可行的。

First of all, you can use Recaptcha for .NET (http://recaptchanet.codeplex.com) to use a robust and secure captcha solution for your MVC .NET project.

When you submit the form, create a cookie and encrypt its values with the user's session ID as its key and have its expiration time to be something like 5 minutes. Read the cookie from the captcha page. I am assuming that you don't want to store the values on the server and query string is obviously not feasible.

此刻的回忆 2024-09-18 13:00:45

我建议使用 MVCRecaptcha (https://mvcrecaptcha.codeplex.com/) 。请注意 - 特别是 MVCRecaptcha 而不是其他一些密切相关的实现。

但是,请从 Nuget 下载该软件包,请确保您没有下载其他可用的 Recaptcha 软件包 - 您应该专门下载 MVC recaptcha。

然后按照 MVC recaptcha codeplex 站点上的其余说明进行操作即可启动并运行。

I would recommend using MVCRecaptcha (https://mvcrecaptcha.codeplex.com/). Please note - specifically MVCRecaptcha and not some of the other closely related implementations.

Download the package from Nuget, however, make SURE that you don't download the other Recaptcha packages that are available - you should specifically download MVC recaptcha.

Then follow the rest of the instructions on the MVC recaptcha codeplex site to get up and running.

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