I am working on allowing users to log into my site using either facebook or the standard asp.net membership.
I am using the c# facebook sdk.
The first time the user logs into the site using facebook I create a new user in the membership database using their facebook id as their username and generate a random password.
So all is good I have created the new user account however I am not sure how to authenticate the logged in user against my membership database.
Within FormsAuthentication I can see a method to authenticate
FormsAuthentication.Authenticate()
It requires name and password.
Can I authenticate the user against my membership database without knowing the password? I don’t want to know the password so I need to ensure a random one is always generated.
Don’t know if that’s your case but maybe SetAuthCookie() method will solve your problem.
http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.setauthcookie.aspx