I'm trying to connect to my Facebook account using Sitecore Social Connected module. After logging in, I'll have to display User's details on my site.
I've used connectedUserManager.LogOnUser
and connectedUserManager.AttachUser
method. But, my database doesn't get details of the Facebook user updated in it. What might be missing? How to retrieve user information, after I'm successfully logged in using Facebook credentials.
const bool IsAsyncProfileUpdate = true;
const string ApplicationItemId = "{A9987983-D946-4E53-8FE4-1EB8BE650B43}";
ConnectUserManager connectUserManager = new ConnectUserManager();
if(!Sitecore.Context.User.IsAuthenticated) {
connectUserManager.LoginUser("Facebook",IsAsyncProfileUpdate, ApplicationItemId);
}
else {
connectUserManager.AttachUser("Facebook", IsAsyncProfileUpdate, ApplicationItemId);
}
You can access all user information pulled in from facebook by looping through the custom profile properties. Please have a look at this blog: Social Connected with Sitecore (Facebook) 2: Access facebook information