Facebook login with SmartGWT?

Has anyone here been able to integrate SmartGWT with Facebook logins? I have an application where I need users to be able to register their facebook accounts.

I.e. I have a smartGWT application and there is a facebook component that I want to add to it. So I want to get the user to autenticate against facebook so that I can get a facebook session.

I have been able to get a bit further with this, but still not sure how to enable a call-back on successful login and failure, if anyone else has some ideas?

This is the solution so far:

a) In my social media listgrid, if the user clicks “New account” (which means that they want to register a Facebook account with the application), my application will open a popup window.
b) The popup window uses the Facebook “Desktop Application” API to do the autentication. This is a URL call and is documented here: http://wiki.developers.facebook.com/index.php/Authorization_and_Authentication_for_Desktop_Applications
c) The popup therefore has the facebook authentication page in it and if the user authenticates the app, it will call the successful URL and if the user cancels or fails to authenticate, it calls the fail URL.

Now the problem is, I can set the URLs for Facebook to call on success or failure, but as this is an application written in smartGWT, how do I trap those?

Ideally, I want the smartGWT app to display something like “Awaiting facebook authentication” or a similar message while the popup with the Facebook page is being displayed. Then on success the smartGWT application grabs the Facebook session ID or, on failure, it cancels the “new account” operation.

What I am looking for is the bit that allows the Facebook callback to the URL to be detected by smartGWT.

Does anyone have any ideas on how I can do this?