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

  • Home
  • SEARCH
  • 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 8258295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:29:29+00:00 2026-06-08T02:29:29+00:00

I an new to the facebook API and after some work I encountered a

  • 0

I an new to the facebook API and after some work I encountered a problem.
First, I am using the facebook SDK for communication with the facebook APIs.

In my app settings I chose that the response of the OAuth dialog should be query string instead of URI fragment.

enter image description here

On my server I got the following code:

void Page_Load()
{
    string url = Request.Url.AbsoluteUri;
    Facebook.FacebookOAuthResult result = null;        
    if (!Facebook.FacebookOAuthResult.TryParse(url, out result))
    {
        string redirectUrl = PivotServer.Helpers.GetFacebookOAuthUrl();
        Response.Redirect(redirectUrl);
    }
}

And thats my helper method:

    public static string GetFacebookOAuthUrl()
    {
        FacebookOAuthClient oauth = new FacebookOAuthClient
        {
            AppId = "149637255147166",
            AppSecret = "xxx",
            RedirectUri = new Uri("http://mydomain.com/")
        };

        var param = new Dictionary<string, object>
        {
            { "response_type", "token" },
            { "display", "popup" }
        };

        Uri url = oauth.GetLoginUrl(param);

        return url.AbsoluteUri;
    }

I ran my page on a web server (IIS). When I open the page the first time I am asked to log in to facebook, which is alright, but then I ran into an infinity loop, because the Auth Token Parameter (from facebook) is an URI fragment instead if a query string (which I wanted (see picture above)).
The response URI looks like

http://mydomain.com/#access_token=AAACIGCNwLp4BAMccSoliF5EMGJm0NPldv5GpmBPIm9z7rRuSkiia7BM0uhEn1V88c8uOlWOfGc3C8sFC9tq90Ma0OwIm0tWLNU5BBAZDZD&expires_in=0&base_domain=mydomain.com

instead of

http://mydomain.com/?code=AAACIGCNwLp4BAMccSoliF5EMGJm0NPldv5GpmBPIm9z7rRuSkiia7BM0uhEn1V88c8uOlWOfGc3C8sFC9tq90Ma0OwIm0tWLNU5BBAZDZD&expires_in=0&base_domain=mydomain.com

Is that a bug from the OAuth API, or what am I doing very wrong here?

  • 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-06-08T02:29:30+00:00Added an answer on June 8, 2026 at 2:29 am

    It has been too easy:

    var param = new Dictionary<string, object>
    {
        { "response_type", "code" }, // <--- "code" instead of "token"
        { "display", "popup" }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i am new in using facebook api i want to get the friends
how to develop new facebook application (login , add photos ) using the api
I am using Facebook PHP SDK to authenticate the user. After generating the LoginUrl
I've been using the old v3.0 C# SDK for some time and Facebook have
I'm fairly new to the Facebook API, so I did some research and came
I have an iframe Facebook application (using Facebook's new JavaScript API) that needs to
i want to know how work facebook new timeline image reposition with jquery? this
I am using an IFrame application with XFBML and the new Javascript API. I'd
I'm trying to use the new Facebook Graph API on my website. This is
I've been trying to get Rails to play with the new Facebook Graph API.

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.