How to implement login/logout in the Facebook through desktop application

You have to take a web browser (e.g. The DJ project), which will be inserted into your desktop application.

Navigate to

and the login form will appear.
You need to input an email and password, and to press Login.

After this user will be redirected to the redirect_uri, which will contain access_token

(note: use WebBrowserListener to parse the token and for other actions)

Now you can get some info, e.g. about current user (use any http-request){access_token}
(server returns JSON)

User will be logged in until the application is running or until cookies exist (if user have selected ‘Keep me logged in’) or expires_in has not ended.
(Note: this browser uses IE cookie for Windows OS)

Thus we should log out from Facebook.
Navigate to{other_url}
and user will be deauthorized (cookeis removed)

More info read on Facebook Authentication