DotNetOpenAuth and Facebook

痴心易碎 提交于 2019-12-10 02:22:41

问题


I'm attempting to use DotNetOpenAuth for some web single sign on functionality.

I got the samples working for Google and Yahoo but am struggling with Facebook.

I am using the CTP (4.0.0.11165) and have followed the example in this SO question.

However, I get a runtime error on the line:

IAuthorizationState authorization = client.ProcessUserAuthorization();

The error is:

Failed to obtain access token. Authorization Server reports reason: (unknown)

Any ideas?


回答1:


The build you're using is incompatible with Facebook because Facebook is using an older spec of OAuth 2.0. You have to use an earlier CTP (one with a v3.5 version) to work with Facebook. Sorry. It stinks to be using OAuth 2.0 when everyone is on a different draft of the unfinalized spec.




回答2:


I was facing the similar issue while using https://github.com/baio/open-mvc .

I resolved it by building again the DotNetOpenAuth.ApplicationBlock project of Latest CTP(4.0.0.11165) with DotNetOpenAuth version 3.5.0.10357 downloaded from open-mvc repo.

And it worked fine for facebook.

I am still testing it for other IDP's




回答3:


I think you need to add

client.ClientCredentialApplicator = ClientCredentialApplicator.PostParameter("App_Secret");


来源:https://stackoverflow.com/questions/6666447/dotnetopenauth-and-facebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!