Search code examples
silverlightfacebooksilverlight-4.0silverlight-ooboauth-2.0

Silverlight OOB (Out of Browser) Using Facebook Graph API


I'm building an out of browser Silverlight app and trying to use the Facebook Graph API, but I'm having trouble getting through the authentication round trip.

I've gone through their Desktop Application Authentication process:

http://developers.facebook.com/docs/authentication/desktop

But I'm stuck on this step:

  • Intercept the redirect above and read the access token out of the URI.

I've tried adding an event handler to the LoadCompleted event of my WebBrowser control, but NavigationEventArgs.Uri is always null:

http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.loadcompleted(v=VS.96).aspx

How am I supposed to get an access token from Facebook if I can't get the current URI out of WebBrowser?


Solution

  • Go here and get the silverlight sample app from the Facebook C# SDK on Codeplex.

    http://facebooksdk.codeplex.com/

    Get the source and you will see the samples. There will be a full release in the next few days with separate downloads for each sample.