Asp.net

Asp.net會員授權無密碼

  • December 9, 2009

要在 Asp.net Membership 中對使用者進行身份驗證,我們可以呼叫方法

FormsAuthentication.Authenticate(username, password)

我如何在沒有使用者密碼的情況下完成相同的工作(生成會話、cookie 和 Authanticate 所做的所有其他工作人員)?

我正在嘗試通過 facebook 連接登錄使用者。使用者的 facebook id 儲存在使用者數據中。使用者應該像普通使用者一樣登錄。

我認為您可以使用 SetAuthCookie 方法。

更多資訊在這裡http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.setauthcookie.aspx

引用自:https://stackoverflow.com/questions/1871010