When user login through Facebook Connect , Facebook ll tell us if the user is authenticated or not. I already have existing
web application using ASP.Net Membership and Role Management Service so I ll need to pass this information and tell ASP.Net Membership Service that this user is OK.
To do that we ll call
FormsAuthentication.RedirectFromLoginPage
Dim userName As String
Dim createPersistentCookie As Boolean
FormsAuthentication.RedirectFromLoginPage(userName, createPersistentCookie)
Refer to FormsAuthentication.RedirectFromLoginPage Method (String, Boolean), http://msdn.microsoft.com/en-us/library/ka5ffkce.aspx
With FormsAuthentication.RedirectFromLoginPage, you just specify username of the user you want to let in. (and set if you want to create cookie that can be used across browser sessions.)
FormsAuthentication.RedirectFromLoginPage redirect user to query string specified URL. ex) login.aspx?ReturlUrl=some URL
Assuming that we have a mapping table in data store which can look up Facebook ID and username of our application, we can feed in
username and have the user logged in during this session.
Both Facebook Connect user and none Facebook Connect user should be able to use basic functions of our applications, but we need to be able to distinguish them in
our application. We ll do so by having ASP.Net roles. We ll talk about that next.