简体   繁体   中英

How can I authenticate XMPP users with Facebook Login API?

I am making a chat application for Android with login with Facebook feature. I decided to use XMPP for IM protocol. I've already managed to implement signing up with Facebook Login API but now I'm wondering how to integrate it to login to XMPP server. I use OpenFire server with MySQL database and Smack API for Java. When connecting to the server I need to provide username and password, but the only information I get from Facebook Login API is a public profile and Facebook user ID.

How can I make OpenFire use Facebook Login API to authenticate my users?

Facebook has implemented XMPP Server for us, so we just need to make the implementation for client.
After googled, i’ve found one Java XMPP Client API called SMACK that I think is suitable for this case. So, I’m going to use this API.
First, you have to download the API from here (last stable version was 3.2.1 when I wrote this note).
After downloaded the API (whether in zip or tar.gz), extract that compressed file to your local directory in your machine.
The file has already came with several documentation, examples, and Doc API. So, it will be easy for us to learn.
For basic use, there are 3 required jar files for this API as follows:

smack.jar
smackx.jar
smackx-debug.jar (used for debug mode, i.e. if you turn on the debug mode).
This link may help you out. please try this.

Facebook Chat Xmpp Services

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM