Hi,
Based on Mudassar Ahmed Khans post(Single Sign on using Facebook), In my asp.net application I added the single sign on functionalty using FaceBook.
But it only shows the userid, email profile photo , id etc.
My need is, after getting the credentials the suser should also be logged in to my application.
For that i need the password also.
If the user is new to my application, i should register the user to my application as well.
I am inluding the login button click event handler which In which I added code for my registration/sign in
#region Login-Facebook
protected void Login(object sender, EventArgs e)
{
FaceBookConnect.Authorize("user_photos,email", Request.Url.AbsoluteUri.Split('?')[0]);
Access _access = new Access();
List<CheckEmail_Result> list = _access.CheckDuplicate(lblEmail.Text);
if (list.Count() > 0)
{
//here i want the user to be automatically signed in by setting some session variables for the user id, email id which i receive from facebook
}
else
{
// this means, the user is new to my application, so i need to register him.
// for this i need password.
MemberDAL mDAL = new MemberDAL();
bool active = true;
int id = mDAL.InsertMember(lblEmail.Text, txtPassword1.Text, active, txtReferrer.Text);
//rest of the code for setting session variables goes here....
.............
}
}
#endregion
Please help to achieve this.
Regards
Bhavana Retheesh