IFrame application with auth.getsession problem

Mar 26, 2010 at 11:27 AM

Hi,

I have a problem with .NET Auth.GetSession function.

I coding an application with this architecture: the "main" is an CanvasIFrameMasterPage, with many normal page behind.

One of this, call a php page outside my IFrame fb app. Here user do many operations (it's impossibile rewrite this part) and at the end user must come back to IFrame fb app.

For do this, I create a page named Callback.aspx is called from php with a redirect like "Callback.aspx?result=X&auth_token=klj2klj32l3k2lm2k3j2h3k23o.

Auth_token is a FB auth_token created at the first user login and it been forwarded to the external application at the first  call outside.

At this point, in Callback.aspx take the auth_token with response.querystring["auth_token"] like this:

 

if(!string.IsNullOrEmpty(Request.QueryString["auth_token"])) {
                session_info s = new session_info();
                string auth_token = Request.QueryString["auth_token"];
                try
                {
                    s = Api.Auth.GetSession(auth_token);
                }
                catch (FacebookException ex)
                {
                    Console.Write(ex.ToString());
                }

if(!string.IsNullOrEmpty(Request.QueryString["auth_token"])) {

                session_info s = new session_info();

                string auth_token = Request.QueryString["auth_token"];

                try

                {

                    s = Api.Auth.GetSession(auth_token);

                }

                catch (FacebookException ex)

                {

                    Console.Write(ex.ToString());

                }

}

But i take a FB Exception!

Without this operation, the IFrame FB app recreate auth_token after than Callback.aspx calls.

 

Sorry for my english, tanks in advantage.