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 3626750
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:48:06+00:00 2026-05-18T23:48:06+00:00

I have an IFrame Facebook application that uses Facebook C# SDK. I also use

  • 0

I have an IFrame Facebook application that uses Facebook C# SDK. I also use jquery and load some page components asynchronously. For example, I call the following javascript from main page(at this point user is authenticated)

$.ajax({            
    type: "POST",
    url: "Ajax/GetMyBalance.aspx",        
    datatype: 'text',
    success: function (html) {
        $('#balance_div').html(html);
    }
    });

The problem is that in GetMyBalance.aspx:PageLoad the user is not authenticated. I tried adding

 FacebookApp app = new FacebookApp();
 CanvasAuthorizer auth = new CanvasAuthorizer(app);
 if (!auth.IsAuthorized()) // always true when page is loaded first time
 {
    var url = auth.GetLoginUrl(new HttpRequestWrapper(Request));
    var content = CanvasUrlBuilder.GetCanvasRedirectHtml(url);
    Response.ContentType = "text/html";
    Response.Write(content);
    Response.End();
 }

to GetMyBalance.aspx:PageLoad ; it did authenticate the user, but it also redirected browser to Myapp/Ajax/GetMyBalance.aspx which might make sense, but it’s absolutely not what I wanted. How can I authenticate user in this case ?
Thanks for your answers.

  • 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-18T23:48:07+00:00Added an answer on May 18, 2026 at 11:48 pm

    You can do it with no cookies. Set cookieSupport = false in the SDK settings and initialize the Javascript client library with cookie=false. Then get the auth token using the Javascript client library before you post, pass the auth token up to the server, and use it to instantiate your FacebookApp instance.

            FB.getLoginStatus(function (response) {
              if (response.session) {
                $('#AuthToken').val(response.session.access_token);
                $('form').ajaxSubmit(options);
                return false;
              } else {
                // not logged in, prompt them to retry
                return false;
              }
            }, true);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a facebook iframe application that is having trouble redirecting, I keep getting
I have created an iframe facebook application. I want to use the facebook's comments
I have an iframe Facebook application (using Facebook's new JavaScript API) that needs to
Basically, I have an iframe embedded in a page and the iframe has some
I have created an iframe code that I want people to use as a
I have a page that has an iframe From one of the pages within
I have a page P1 loading from site S1 which contains an iframe. That
I have a web application that I am trying to port to Facebook. The
I have a Facebook application that has a picture gallery. It's build in Flex
I have a facebook iframe application where i have provided a share functionality. I

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.