小编gui*_*uik的帖子

在localhost上Smack和Openfire之间的路由错误

我有一个实现Smack 4.1.7的Java应用程序,我将其用作Openfire 4.0.2的模拟客户端.目前,Openfire正在我的localhost上运行.Smack可以使用此连接正确登录和验证:

XMPPTCPConnectionConfiguration conf = XMPPTCPConnectionConfiguration.builder()
      .setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
      .setServiceName(XMPP_HOST_NAME) // equals xmppDomain on server
      .setUsernameAndPassword("user1", "pwd1")
      .setResource("tester")
      .setDebuggerEnabled(true)
      .build();
Run Code Online (Sandbox Code Playgroud)

现在当Smack尝试创建或加入MUC时,请求超时(SmackException $ NoResponseException)和Openfire记录以下内容:

2016.07.03 18:58:54 org.jivesoftware.openfire.spi.RoutingTableImpl - 
Unable to route packet. Packet should only be sent to available sessions and the 
route is not available. 
<presence id="WrkXH-6" from="user1@localhost/tester" to="user1@localhost/tester">
    <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.igniterealtime.org/projects/smack" ver="NfJ3flI83zSdUDzCEICtbypursw="/>
</presence>
2016.07.03 18:58:54 org.jivesoftware.openfire.spi.RoutingTableImpl - 
Failed to route packet to JID: user1@localhost/tester packet: 
<presence id="WrkXH-6" from="user1@localhost/tester" to="user1@localhost/tester">
    <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.igniterealtime.org/projects/smack" ver="NfJ3flI83zSdUDzCEICtbypursw="/>
</presence>
Run Code Online (Sandbox Code Playgroud)

我在服务器端和客户端都使用了"localhost","127.0.0.1"和我的机器名称作为XMPP_HOST_NAME,我不断收到同样的错误.任何帮助,将不胜感激.

openfire localhost smack

8
推荐指数
1
解决办法
571
查看次数

Firebase服务器端verifyIdToken()在幕后做了什么?

我正在考虑使用Firebase执行身份验证.我是JWT的新手,所以我很抱歉这是一个显而易见的问题,但我不明白验证是如何实际完成的.它似乎是FirebaseAuth.getInstance().verifyIdToken(idToken)异步工作的,因为结果是通过监听器获得的.我知道有些证书是按照此处所述使用的,并且这些证书会定期轮换.是否意味着每次打电话时我的后端服务器和Firebase服务器之间都需要联网verifyIdToken()?这不是问题吗?

verify token firebase firebase-authentication

8
推荐指数
1
解决办法
1306
查看次数

如何从 Smack 4.1 创建帐户

我正在尝试在 jabber.at 上从 Smack for Android 创建一个帐户。这是我的代码:

XMPPTCPConnectionConfiguration conf= XMPPTCPConnectionConfiguration.builder()
                                .setServiceName("jabber.at")
                                .build();
XMPPTCPConnection connection = new XMPPTCPConnection(conf);

connection.addConnectionListener(xmppConnectionListener);
connection.connect();

AccountManager accountManager = AccountManager.getInstance(connection);
Map<String, String> map = new HashMap<String, String>();
map.put("username", usr);
map.put("password", pwd);
map.put("email", email);
accountManager.createAccount(usr, pwd, map);
Run Code Online (Sandbox Code Playgroud)

我有一个错误:

W/System.err? org.jivesoftware.smack.packet.XMPPError@2beba168
W/System.err? at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:217)
W/System.err? at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:198)
Run Code Online (Sandbox Code Playgroud)

我试过有和没有地图,同样的错误。根据 jabber.at 的 Mathias Ertl 的说法,可以远程创建帐户,所以我在某处做错了。任何的想法 ?

android xmpp smack

5
推荐指数
1
解决办法
2917
查看次数