.Net 表单身份验证
我正在 mvc2 中开发一个网站,并且使用 .net 身份验证。我该如何更改我的登录授权以使用电子邮件和密码。
谢谢
I'm developing a website in mvc2, and i'm using the .net Authentication. How can i do to change my login authorization to use email and password.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在发出身份验证 cookie 的控制器操作内,只需检查邮件是否与密码匹配,并使用电子邮件作为身份验证 cookie 的用户名:
Inside your controller action which emits the authentication cookie just check if the mail matches the password and use the email as username for the authentication cookie: