1

How do I login into Facebook and get a accesstoken in Java with a desktop application only?

I found a api http://restfb.com that lets you call methods but you have to get the token yourself. So is there a way to do this using only a desktop app? Maybe embed a browser to a window popup?

I already know the process in getting a token explained here http://benbiddington.wordpress.com/2010/04/23/facebook-graph-api-getting-access-tokens so my question doesnt involve that. I need a way for the user to login into facebook using some kind of GUI.

likebeats
  • 876
  • 7
  • 18
  • What about [Leeloo](http://leeloo.smartam.net/)? – sp00m Apr 19 '12 at 15:48
  • im trying to run the demo they provide https://cwiki.apache.org/confluence/display/AMBER/OAuth+2.0+Client+Demo and requires that i use javax.servlet, which i dont seem to have :( – likebeats Apr 19 '12 at 19:11

1 Answers1

0

As in the facebook document

Our OAuth 2.0 implementation does not include explicit support for application built for desktop operating systems. However, if your app can embed a web browser (most desktop frameworks such as .NET, AIR and Cocoa support embedding browsers), you can use the client-side flow with one modification: a specific redirect_uri. Rather than requiring desktop apps to host a web server and populate the Site URL in the Developer App, we provide a specific URL you can use with desktop apps: https://www.facebook.com/connect/login_success.html.

I think you are right about embed web browser.

And I suggest you to move to Graph API instead of Rest, Because It's deprecating.

see more abount Facebook Authentication

Deprecating the REST API

Hereblur
  • 2,084
  • 1
  • 19
  • 22