没有密码的Asp.net Memebership授权

Ant*_*nte 7 asp.net facebook asp.net-membership

要在Asp.net成员资格中自动验证用户,我们可以调用方法

FormsAuthentication.Authenticate(username, password)
Run Code Online (Sandbox Code Playgroud)

如何在没有用户密码的情况下完成相同的工作(生成会话,cookie和Authanticate所有其他工作人员)?

我正在尝试通过facebook连接登录用户.用户的Facebook ID存储在用户数据中.用户应该像普通用户一样登录.

Joh*_*ker 11

我想你可以使用SetAuthCookie方法.

更多信息请访问http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.setauthcookie.aspx

  • 当我问WebSecurity.CurrentUserName时它不能正常工作它给了我以前的用户.!! (2认同)