是否可以覆盖 Facebook C# SDK 中的 CookieSupport 配置?
我有一个 ASP.NET MVC 3 应用程序,其中使用 Facebook C# SDK 进行了一些 Facebook 集成,并启用了 cookie 支持。
我曾计划(并且仍然愿意)创建一个画布 Facebook 应用程序作为主应用程序的一个区域。问题是画布应用程序要求关闭 cookie 支持。是否有办法覆盖该区域中的此设置,或者我被困住了?
2011 年 11 月 1 日更新 我在 web.config 中使用了 location
节点来覆盖 cookieSupport
设置。
<location path="facebook">
<facebookSettings
appSecret="***"
appId="***"
cookieSupport="false" />
<canvasSettings
canvasPageUrl="http://apps.facebook.com/***/"
canvasUrl="http://www.***.co.uk/facebook/"
authorizeCancelUrl="http://apps.facebook.com/***/home/cancel" />
</location>
它似乎可以毫无问题地对已授权该应用程序的用户进行身份验证。但是,尚未获得授权的用户不会获得身份验证(他们看不到权限对话框)。
我应该强调,当“facebook”区域的结构放入它自己的应用程序中时,配置会按预期工作。
富有的
I have an ASP.NET MVC 3 application with some Facebook integration using the Facebook C# SDK with cookie support switched on.
I had planned (and would still like) to create a canvas Facebook application as an Area of the main application. The problem is that canvas applications require that cookie support be turned off. Is there anyway to override this setting in the Area, or am I stuck?
Update 11/01/2011
I used the location
node in web.config in order to override the cookieSupport
setting.
<location path="facebook">
<facebookSettings
appSecret="***"
appId="***"
cookieSupport="false" />
<canvasSettings
canvasPageUrl="http://apps.facebook.com/***/"
canvasUrl="http://www.***.co.uk/facebook/"
authorizeCancelUrl="http://apps.facebook.com/***/home/cancel" />
</location>
It appears to authenticate users who have already authorised the app without issue. However users who're have not yet authorised do not get authenticated (they don't see the permission dialog).
I should stress that the configuration works as expected when the structure of the Area 'facebook' is put into an app of it's own.
Rich
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
即使您无法通过特定于区域的 web.config 文件来完成此操作,您也可以随时跳过 web.config 中的设置并手动设置它们:
Even if you can't do it via an area-specific web.config file, you could always just skip the settings in the web.config and set them manually:
事实证明,这是 ASP.NET MVC3 RC2 和 Facebook C# SDK 4.1.1 之间的一个问题。有关详细信息,请参阅 http://facebooksdk.codeplex.com/workitem/5794。
该问题已在 SDK 4.2.1 版本中得到解决。
富有的
This turned out to be an issue somewhere between ASP.NET MVC3 RC2 and the Facebook C# SDK 4.1.1. See http://facebooksdk.codeplex.com/workitem/5794 for details.
The issue has since been resolved in version 4.2.1 of the SDK.
Rich