Search code examples
facebookgrailsspring-security

Facebook Connect Problems With Grails


I am trying to use the Grails Facebook Authentication plugin but am running into problem. I have (I believe) successfully installed the plugin, put a facebook connect control on a page, and ran the installation script.

When I click on the Facebook Connect button I am correctly brought to Facebook, where I login correctly. At this point the popup closes and nothing happens. I have a custom FacebookAuthService but no breakpoints inside ever get called. I believe I have either 1) hooked up the Service incorrectly or 2) hosed up my Facebook settings so that I am not getting the information back, but I am not sure how to diagnose the problem.

When I run the app locally, it runs on http://localhost:8080/TestApp
In my Facebook App Settings I have tried using "http://localhost", "http://localhost:8080", and "http://localhost:8080/TestApp" as the Site URL and I have "localhost" as the App Domain. What am I missing?

Here is a link to the GitHub Project (I've changed the fb private key).

Any ideas? Thanks.


Solution

  • Button authorizes you only on client side, because of Facebook Javascript SDK. Please reload page after successful authorization, like:

      FB.getLoginStatus(function(response) {
        if (typeof(response) == 'undefined') {
          return
        }
        if (response.status == 'connected') {
          window.location.reload();
        }
      })