Note: A Desktop is a system that doesn't have facebook's SDK support and is able to launch a web view, such as Java GUI, .NET GUI and so on.
You will obtain Facebook's OAuth2 code according to Manually Build a Login Flow and send it to http://your-backend/token/new/social/by-auth-code/facebook/desktop .
- Create a facebook APP if you haven't got one.
- Add "https://www.facebook.com/connect/login_success.html" to the APP's "Valid OAuth redirect URIs".
- Follow the manual flow, and check out our sample code.
- Make a simple button
- See facebookCodeLoginBtn.addActionListener(). You will construct the facebook auth url, launch it with a web view inside your client application.
- See WebEngineChangeListener.changed(). You will monitor the browser's URL until you get the auth code, and then send the code to srb4j's back end.
- getEmailFromCode is the server-side code. You don't have to change it, but you will set "facebookClientId" and "facebookClientId" on app.properties.