Set*_*eth 5 asp.net-mvc simplemembership
我想使用WebSecurity + SimpleMembership,但实现(可选)通过自定义/替代身份验证方法登录用户的能力.
WebSecurity.Login只有一个方法签名,需要用户名和密码.我想跳过密码检查,例如:
if (MyCustomAuthenticationMethod.Authenticate(username, customData)) {
WebSecurity.Login(username); // Login without password check, method doesn't exist though
}
Run Code Online (Sandbox Code Playgroud)
我假设在OAuthWebSecurity存在的情况下可以使用自定义身份验证方法,但我不确定如何实现自己的方法.
好吧,你可以简单地回到身份验证的根目录并直接调用
FormsAuthentication.SetAuthCookie
Run Code Online (Sandbox Code Playgroud)
这将创建cookie并验证您的用户.请参阅Asp.net Memebership Authorization,无需密码
| 归档时间: |
|
| 查看次数: |
2379 次 |
| 最近记录: |