简体   繁体   English

DotNetOpenAuth Facebook集成ASP.NET WebForms

[英]DotNetOpenAuth Facebook Integration ASP.NET WebForms

I have been trying to integrate Facebook Login based on the sample code provided by DNOA but i have been unsuccessful. 我一直在尝试基于DNOA提供的示例代码来集成Facebook登录,但是我没有成功。

Here is what i have done: 这是我所做的:

  1. Imported the latest DNOA packages via NuGet Package Manager(v4.3.3.13295). 通过NuGet软件包管理器(v4.3.3.13295)导入了最新的DNOA软件包。
  2. I have setup a Facebook Dev account and testing app, importing the relevant keys into my webconfig. 我已经设置了一个Facebook Dev帐户和测试应用程序,并将相关密钥导入到我的webconfig中。
  3. I have integrated the facebook login code into the membership provider and all works well. 我已经将Facebook登录代码集成到了成员资格提供程序中,并且一切正常。

The problem arrises when i call the below code again after Facebook redirects back to my site: IAuthorizationState authorization = fbClient.ProcessUserAuthorization(); 当Facebook重定向回我的网站后再次调用以下代码时,问题出现:IAuthorizationState授权= fbClient.ProcessUserAuthorization();。

I get an error saying: 400(Bad Request) 我收到一条错误消息:400(Bad Request)

After reading around on the net i have found the following: "If you're using the latest DNOA 4.0 CTP, Facebook is incompatible with it because it implements an older draft of OAuth 2.0" from: Login with facebook using DotNetOpenAuth 4.0 在网上阅读后,我发现:“如果您使用的是最新的DNOA 4.0 CTP,则Facebook与之不兼容,因为它实现了OAuth 2.0的较早草稿”,来自: 使用DotNetOpenAuth 4.0登录Facebook

Can anyone confirm that this is the case and if so can you please provide me with a link to an older version that works? 谁能确认是这种情况,如果可以,请提供给我一个旧版本的链接吗?

Thanks. 谢谢。

The solution is to never call 解决的办法是永远不要打电话

IAuthorizationState authorization = fbClient.ProcessUserAuthorization(); IAuthorizationState授权= fbClient.ProcessUserAuthorization();

more than once. 不止一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM