【发布时间】:2016-09-11 23:43:59
【问题描述】:
我已经在 Sitecore 7.2 上安装了社交连接模块 2.1,然后我配置了个人资料映射、facebook 应用程序,一切都很顺利。
当我尝试使用“使用 facebook 登录”渲染登录时,我会重定向到带有错误查询字符串的同一页面:
http://sc72rev151021.com/registration?authResult=error_9ffsede-dsdf6-4f50-9b6a-asdasdasd
我检查了日志文件,我看到了这个错误:
28144 10:24:36 错误 ConnectManager 中发生错误异常: Sitecore.Social.Infrastructure.Exceptions.SocialException 消息: 字典中没有给定的键。
嵌套异常
异常:System.Collections.Generic.KeyNotFoundException 消息: 字典中不存在给定的键。来源:mscorlib
在 System.Collections.Generic.Dictionary`2.get_Item(TKey key) 在 Sitecore.Social.Facebook.Networks.Providers.FacebookProvider.GetAccountBasicData(帐户 帐户)在 Sitecore.Social.Client.Api.ConnectorClientManager.Connect(帐户 account, Boolean attachAccountToLoggedInUser, Boolean isAsyncProfileUpdate) 在 Sitecore.Social.Client.Api.Connector.ConnectorAuthCompleted.AuthCompleted(AuthCompletedArgs 参数)
然后我重新编译了 DLL,代码在这里崩溃(以下代码 sn-p 来自 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>);
}
有什么想法吗?这个模块是否依赖于弃用的 facebook 键?
谢谢
【问题讨论】:
-
您能否提供您在尝试登录后被重定向到的 Facebook 页面的 URL?我猜它转移了过时的权限范围。
-
感谢 Anton 的帮助,首先用户在此页面上 sc72rev151021.com/registration 然后他尝试使用 facebook 渲染登录,然后他将重定向到同一页面 sc72rev151021.com/…
-
您提到的两个页面之间应该有一个对 Facebook 的中间请求。使用浏览器中的 Fiddler 或网络开发者工具面板来获取它。
标签: sitecore sitecore7 sitecore-social-connected