I have a Silverlight app that will be used by users as a kiosk app. One user will come along, use the app, log-in to Facebook and do his thing, then the next user will come along and restart the process, also logging-in to Facebook and doing his thing.
Problem is, I can’t log the first user out of Facebook.
I’m using a web browser control within my app and, I know this is a little out of date, but I followed the instructions on Prabir’s blog, http://blog.prabir.me/post/Facebook-CSharp-SDK-Logout.aspx, to get my logout function working.
Here is my logout function:
private void SetFacebookLogoutSource()
{
var fbClient = new Facebook.FacebookClient();
var logoutParameters = new Dictionary<string, object>
{
{ "next", GenerateLoginUrl(fbClient, "publish_actions").AbsoluteUri }
};
var logoutUrl = fbClient.GetLogoutUrl(logoutParameters);
webBrowser.Navigate(logoutUrl);
}
But this just takes me to the last logged in users Facebook wall.
The GenerateLoginUrl method works as it’s what I use to get the login URL first time around.
Any ideas?
Thanks,
Greg.
It looks like Facebook requires an access_token to be logged out (although, correct me if I’m wrong) and this is working for me:
I now have another problem… I don’t get an access_key if they don’t approve my app’s permissions, so I can’t log them out, they stay in some kind of limbo state! The joys of working with Facebook API 🙂
/Greg