如何使用Facebook Login API对XMPP用户进行身份验证?

时间:2017-09-21 08:45:03

标签: android facebook authentication xmpp openfire

我正在使用Facebook功能登录Android的聊天应用程序。我决定使用XMPP进行IM协议。我已经设法用Facebook Login API实现注册,但现在我想知道如何将它集成到登录XMPP服务器。我使用OpenFire服务器和MySQL数据库以及Smack API for Java。当连接到服务器时,我需要提供用户名和密码,但我从Facebook Login API获得的唯一信息是公共个人资料和Facebook用户ID。

如何让OpenFire使用Facebook Login API对我的用户进行身份验证?

1 个答案:

答案 0 :(得分:0)

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