DotNetOpenAuth and Facebook
Asked Answered
D

3

11

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?

Droll answered 12/7, 2011 at 15:7 Comment(0)
C
12

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.

Carincarina answered 13/7, 2011 at 4:56 Comment(6)
I downloaded the ctp and can't find samples for fb in there? i have the master branch and it does. but you're saying they won't work. Should I expect to see samples in the ctp for fb?Sink
Also, if i use this ctp version, will i find myself in a strange place further down the line? are fb planning on coming in line with everyone else at some point?Sink
I can't speak for Facebook, but I can only imagine that they'll adopt the final version of OAuth 2.0 when it is (finally) finalized. The earlier version of the DNOA CTP that does interop with FB does include a facebook sample, yes.Carincarina
the one on the download doesn't: sourceforge.net/projects/dnoa/files/releases/v3.4/v3.4.7/…Sink
Andrew, is this still actual? Getting similar exception while using DNOA version 4.0.0Beverleebeverley
DNOA 4.0.0 is pretty old too. I don't remember whether that should work with Facebook. But the latest version should work (4.2.2, IIRC)Carincarina
C
0

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

Cheryle answered 20/1, 2012 at 11:59 Comment(0)
M
0

I think you need to add

client.ClientCredentialApplicator = ClientCredentialApplicator.PostParameter("App_Secret");
Madalinemadalyn answered 30/6, 2013 at 19:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.