views:

14

answers:

0

I have a .NET MVC project where I have implemented Facebook connect. This worked fine in my development environment but is causing me issues after deploying to the production server. I serve the facebook connect button from the Index page of my home view like this

<fb:login-button perms="email" onlogin="window.location='/Account/AuthenticateFacebook';"></fb:login-button>

In my Account controller I do the facebook authentication as follows

public ActionResult AuthenticateFacebook()
        {

            FBConnectAuthentication auth = new FBConnectAuthentication(System.Configuration.ConfigurationManager.AppSettings["FBappId"], System.Configuration.ConfigurationManager.AppSettings["FBseceret"]);
            if (auth.Validate() == ValidationState.Valid)
            {
                FBConnectSession fbSession = auth.GetSession();

                ...(more authentication code)...

                return RedirectToAction("Register", "Account");
            }

            return RedirectToAction("Index", "Home");


        }

This all works fine in Visual Studio but when I port to the production server it acts as if the AuthenticateFacebook() function is non-existent. I have changed the path in the facebook login button to

<fb:login-button perms="email" onlogin="window.location='Mysite/Account/AuthenticateFacebook';"></fb:login-button>

to match the path on the server and I also changed the path in the facebook settings on facebook for my app, but I get a 404 error after the facebook login tries to redirect to the controller. Why does this work fine in Visual Studio but not on my server?