使用机制,DIGEST-MD5 asmack在Android的登录异常SASL身份验证失败身份验证、异常、机制、DIGEST

2023-09-06 05:03:20 作者:别离趁早

我米试图与XMPP服务器连接,但即时得到异常

使用

登录异常SASL认证失败的机制,DIGEST-MD5

我用这个code,任何一个可以帮助我,或code

 尝试{
        如果(xmppConnection == NULL){
            ConnectionConfiguration配置=新ConnectionConfiguration(
                    SERVER_HOST,SERVER_PORT,SERVICE_NAME);
            xmppConnection =新XMPPConnection(配置);
            的System.out.println(xmppConnection+ xmppConnection);
        }

        如果(!xmppConnection.isConnected()){
            xmppConnection.connect();
            的System.out.println(连接);
        }

        的System.out.println(Facebook的帐号获得XMPP协议+用户名);

        如果(!xmppConnection.isAuthenticated()){
            xmppConnection.login(用户名,123);
            的System.out.println(用户进行身份验证);

        }
        presence presence =新的presence(presence.Type.available);
        xmppConnection.sendPacket(presence);
                 }赶上(例外五){
        的System.out.println(登录异常+ E);
        e.printStackTrace();
    }
 

解决方案

在Openfire的配置是machinename.domain.com

专业md5助手绿色免安装硬盘版下载 小黑专业md5助手软件下载

这SASL机制使用也XMPP域名进行身份验证,不但用户名和密码。这就是为什么认证失败。

意味着你的用户名和放大器;密码必须是这样的:

用户名: abc111@domain.com(无论您正在访问的域名)

密码: abcabc111

有关更详细的检查了这谈话。

I m try to connect with Xmpp server,But i m getting exception

Login exception SASL authentication failed using mechanism DIGEST-MD5

i use this code ,can any one help me,or code

  try {
        if (xmppConnection == null) {
            ConnectionConfiguration config = new ConnectionConfiguration(
                    SERVER_HOST, SERVER_PORT, SERVICE_NAME);
            xmppConnection = new XMPPConnection(config);
            System.out.println("xmppConnection"+xmppConnection);
        }

        if (!xmppConnection.isConnected()) {
            xmppConnection.connect();
            System.out.println("Connecting");
        }

        System.out.println("facebook id get xmpp "+username);

        if (!xmppConnection.isAuthenticated()) {
            xmppConnection.login(username, "123");
            System.out.println("User is authenticated ");

        }
        Presence presence = new Presence(Presence.Type.available);
        xmppConnection.sendPacket(presence);
                 } catch (Exception e) {
        System.out.println("Login exception "+e);
        e.printStackTrace();
    } 

解决方案

In the Openfire configuration it is machinename.domain.com

This SASL mechanism uses also the Xmpp Domain name for authentication, not only username and password. This is why authentication fails.

mean your username & password must be like:

username: abc111@domain.com (whatever your domain name)

password: abcabc111

for more detail check this conversation.