Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6090029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:10:01+00:00 2026-05-23T12:10:01+00:00

I am trying to add a feature for logging out, which is called in

  • 0

I am trying to add a feature for logging out, which is called in the click event of a ApplicationBarMenuItem, following the instructions on this blog

This is what my code looks like:

    var oauth = new FacebookOAuthClient();

    var logoutParameters = new Dictionary<string, object>
          {
              { "next", "http://www.facebook.com" }
          };

    var logoutUrl = oauth.GetLogoutUrl(logoutParameters);

    LayoutRoot.Children.Add(FacebookLoginBrowser);
    FacebookLoginBrowser.Navigate(new Uri(logoutUrl.AbsoluteUri, UriKind.Absolute));

What I expected this code would do is log the user out of Facebook when the Navigated event completes and then displays whatever URL is passed in the parameter (in this case facebook.com). However, what I’m seeing is that it always loads “http://m.facebook.com/” regardless of what is passed in and it does not logout of Facebook. I don’t care what it loads after (that would be great, but at this point I just want it to do the logout action so the user can quit and login when they launch my app again). The only way I can successfully logout a user is if they understand when the page loads that they need to scroll down, zoom in, and click “logout” manually at the bottom of the page – which just isn’t an acceptable user experience.

I also downloaded the sample code from that blog and it does roughly the same.

I’ve seen this and this post and the URL used is pretty close to what is returned by oath.GetLogoutUrl(logoutParameters), but I tried constructing the exact URL with the same result:

var logoutUrl = new Uri("https://www.facebook.com/logout.php?next=http://www.facebook.com&access_token="+fbClient.AccessToken);

This is definitely a ship stopper for my app, so any help or suggestions anyone can provide would be much appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:10:01+00:00Added an answer on May 23, 2026 at 12:10 pm

    It turns out the problem was that the domain in the redirect URL did not match the one provided as the Site Domain in the app settings on Facebook. Obviously, no one could see that because you don’t have access to my app settings, but it is a bit of a clue that my app couldn’t be registered with “http://www.facebook.com” (as I believe the domain has to be unique).

    The solution is to use my own website in the next parameter, which in my case is thecruxapp.com. Also, session_key and api_key were required, so in the end the code that worked for me was:

    string logout_format = "http://www.facebook.com/logout.php?api_key={0}&session_key={1}&next={2}";
    string access_token = HttpUtility.UrlDecode(fbClient.AccessToken);
    char[] tokenSeparator = new char[] { '|' };
    string session = access_token.Split(tokenSeparator)[1];
    
    FacebookLoginBrowser.Navigate(new Uri(string.Format(logout_format, apiKey, HttpUtility.UrlEncode(session), HttpUtility.UrlEncode("http://thecruxapp.com"))));
    

    I am not experiencing the bug that was linked to in another answer and it wasn’t related – both logout and the redirect occur just fine as long as the URL passed into the next parameter matches the Site Domain entered in the apps settings on Facebook.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out a way to add a self-update feature to a
I'm trying add a tab to my web page that looks like this: Using
I'm trying to add a feature in python that copies the entire contents of
I am trying to add an autocomplete feature to a textbox, the results are
I'm trying to add a simple feature to my app, it should simply send
I'm developing a simple Blogging/Bookmarking platform and I'm trying to add a tags-explorer/drill-down feature
Trying to add an onclick handler to my tabs, and can't seem to get
trying to add an ExpiresDefault ExpiresByType to content on my website so that way
I was trying to add a favicon to a website earlier and looked for
I'm trying to add support for stackoverflow feeds in my rss reader but SelectNodes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.