I have installed social connected module 2.1 on Sitecore 7.2, then I configured the profile mapping, facebook app, everything was going well.
When I try to login using the "Login with facebook" rendering, I'm getting redirect to the same page with an error query string:
http://sc72rev151021.com/registration?authResult=error_9ffsede-dsdf6-4f50-9b6a-asdasdasd
I checked the log file and I see this error:
28144 10:24:36 ERROR The error in ConnectManager occured Exception: Sitecore.Social.Infrastructure.Exceptions.SocialException Message: The given key was not present in the dictionary.
Nested Exception
Exception: System.Collections.Generic.KeyNotFoundException Message: The given key was not present in the dictionary. Source: mscorlib
at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Sitecore.Social.Facebook.Networks.Providers.FacebookProvider.GetAccountBasicData(Account account) at Sitecore.Social.Client.Api.ConnectorClientManager.Connect(Account account, Boolean attachAccountToLoggedInUser, Boolean isAsyncProfileUpdate) at Sitecore.Social.Client.Api.Connector.ConnectorAuthCompleted.AuthCompleted(AuthCompletedArgs args)
Then I recompiled the DLLs, and the code is crashing here (the following code snippet from Sitecore.Social.Facebook.dll ):
public AccountBasicData GetAccountBasicData(Account account)
{
Assert.IsNotNull(account, "Account parameter is null");
IDictionary<string, object> accountData = this.GetAccountData(account, "/me");
if (accountData == null)
{
return null;
}
string str = string.Concat(accountData["first_name"], " ", accountData["last_name"]);
AccountBasicData accountBasicDatum = new AccountBasicData()
{
Account = account,
Id = accountData["id"] as string,
Email = accountData["email"] as string,
FullName = str
};
return accountBasicDatum;
}
private IDictionary<string, object> GetAccountData(Account account, string access)
{
return this.FacebookRequest(account, access, null, (FacebookClient facebookClient, string feedPath, object inputParams) => facebookClient.Get(feedPath) as IDictionary<string, object>);
}
Any Idea ? Is this module depends on deprecated facebook keys ?
Thank you
The solution for this issue is the following:
Remove the code inside the function, and add the following code instead.
string item; Assert.IsNotNull(account, "Account parameter is null");