rexposadas
rexposadas

Reputation: 3189

"Unknown URL" when integrating Facebook connect with a GAE application

I am trying to integrate facebook with a GAE application. When I go to the page where the facebook login button is I get an alert box with the message "Unknown url". Is this a configuration issue? How can I resolve this?

My Java Code:

    private static final String ApiKey = "xxxxxxxxx";    
    private FBCore fbCore = GWT.create(FBCore.class);    
    private boolean status = true;
    private boolean xfbml = true;
    private boolean cookie = true;

...

        fbCore.init(ApiKey, status, cookie, xfbml);

In my HTML I have

 <div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>

In my facebook application I set the site url to something like:

site url: http://127.0.0.1:8888/MyApplication.html? canvas url: http://127.0.0.1:8888/MyApplication.html?

Looking at IE I see this error generated:

Message: OAuth2 specification states that 'perms' should now be called 'scope'. Please update. Line: 23 Char: 1336 Code: 0 URI: http://connect.facebook.net/en_US/all.js

Thanks in advance.

Upvotes: 0

Views: 199

Answers (1)

Peter Knego
Peter Knego

Reputation: 80340

A few notes:

  1. You are not authenticating your GAE (server) app with Facebook. To do this you should use server-side flow.

  2. What you are doing is using GwtFB (I assume), which is a wrapper around Facebook javascript client library. This library implements client-side flow, where only client (js app in browser) is authenticated against Facebook.

  3. Unfortunately FB does not have a library that implements server-side flow (as this would be server-technology dependent and there are just too much server technologies around to support them all). For a GAE implementation see LeanEngine, specifically the FacebookLoginServlet.java and FacebookAuth.

  4. With server-side flow, you need to register your 'redirect-after-authentication' url with Facebook. So you can not use dev server with private addresses (127.0.0.1, 192.168.1.1, etc..). You need a internet visible address.

Upvotes: 1

Related Questions