I've been doing it as follows :
Step 1. <Stream>
Step 2. <Auth> (PLAIN)
Step 3. <Session>
Stuck here.
This tutorial does not mention dialback: http://ceit.uq.edu.au/content/how-xmpp-works-step-step
However, under 8.3. Protocol of the documentation, it says to use a dialback: http://xmpp.org/rfcs/rfc3920.html
Right now, this is the full response I get from my server:
<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='1027203257' from='mysite.com' version='1.0' xml:lang='en'>
<stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='yy7di5kE0syuCXOQTXNBTclpJWo='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
<stream:error><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error>
</stream:stream>
I've seen in some peoples code, after step 2, they run <stream> again, but in others they don't. Is this needed?
Server Dialback is uses for s2s (server-to-server) connections. You don't need it for c2s (client-to-server) connections.
Related
I have setup openfire server and my android clients works well with it except that I am unable to publish avatars , the problem is that the server simply ignores the publish avatar iq packet , no errors , nothing in the log files. I am using standard XMPP pep avatar stanza , please hep
Thankyou for your replies everyone, I found that the issue is with openfire server 3.10 which does not parse the standard XEP 0084 stanza well, infact I found the logs and server was crashing so i modified the IQ as , for example this should be the standard IQ for publishing avatar
<iq type='set' from='juliet#capulet.lit/chamber' id='publish1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:avatar:data'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<data xmlns='urn:xmpp:avatar:data'>
qANQR1DBwU4DX7jmYZnncm...
</data>
</item>
</publish>
</pubsub>
</iq>
but as you can see there is no "to" address in the standard IQ , openfire server would create the pubsub node in DB and crash and would not reply with result asking the user to now publish metadata ,so what i had to do is send this packet and then the standard metadata packet , but then send meta data packet again with a "to" address which would be replied by the server as result that the metadata notification succeded as
standard meta data to be sent to server for the first time ,
<iq type='set' from='juliet#capulet.lit/chamber' id='publish2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:avatar:metadata'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<metadata xmlns='urn:xmpp:avatar:metadata'>
<info bytes='12345'
id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'
height='64'
type='image/png'
width='64'/>
</metadata>
</item>
</publish>
</pubsub>
</iq>
and then again like this with addition of "to" address
<iq type='set' from='juliet#capulet.lit/chamber' to="mydomain.com" id='publish2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:avatar:metadata'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<metadata xmlns='urn:xmpp:avatar:metadata'>
<info bytes='12345'
id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'
height='64'
type='image/png'
width='64'/>
</metadata>
</item>
</publish>
</pubsub>
</iq>
in the above way avatar publishing is working and Im successfully issuing a notification to other users also
and here is the server crash log incase
2016.03.02 10:41:02 ERROR [socket_c2s-thread-3]: org.jivesoftware.openfire.handler.IQHandler - Internal server error
java.lang.NullPointerException
at org.jivesoftware.openfire.pubsub.PubSubEngine.createNodeHelper(PubSubEngine.java:1165)
at org.jivesoftware.openfire.pubsub.PubSubEngine.publishItemsToNode(PubSubEngine.java:340)
at org.jivesoftware.openfire.pubsub.PubSubEngine.process(PubSubEngine.java:98)
at org.jivesoftware.openfire.pep.PEPServiceManager.process(PEPServiceManager.java:215)
at org.jivesoftware.openfire.pep.IQPEPHandler.handleIQ(IQPEPHandler.java:423)
at org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:66)
at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:372)
at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:115)
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:78)
at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:342)
at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler.java:99)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:307)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:199)
at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:181)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:109)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:407)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:236)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:769)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:761)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:703)
at java.lang.Thread.run(Unknown Source)
I am trying to create an XMPP server library for an XMPP-based application I will be developing.
I am stuck on trying to authenticate the client with plain SASL. I have already read the RFC at https://www.rfc-editor.org/rfc/rfc6120#section-6.4.6
My problem is that after sending a <success />, receiving and sending a new open tag and an empty features list, the client (Pidgin) proceeds to authenticate using non-SASL authentication. This is a log of the communication (<< means incoming, >> outgoing):
<< <?xml version='1.0' ?><stream:stream to='127.0.0.1' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>
>> <?xml version="1.0" ?>
>> <stream:stream version="1.0" xmlns="jabber:server" xmlns:stream="http://etherx.jabber.org/streams" id="kanapka" from="127.0.0.1">
>> <stream:features>
>> <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
>> <mechanism>
>> PLAIN
>> </mechanism>
>> </mechanisms>
>> </stream:features>
<< <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN' xmlns:ga='http://www.google.com/talk/protocol/auth' ga:client-uses-full-bind-result='true'>AHRlc3R1c2VyAHRlc3RwYXNz</auth>
>> <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
<< <stream:stream to='127.0.0.1' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>
>> <?xml version="1.0" ?>
>> <stream:stream version="1.0" xmlns="jabber:server" xmlns:stream="http://etherx.jabber.org/streams" id="hotdog" from="127.0.0.1">
>> <stream:features />
<< <iq type='get' id='purple46cbc043'><query xmlns='jabber:iq:auth'><username>testuser</username></query></iq>
I am not yet using TLS, nor have I tried any other SASL mechanism. This is all plain text.
This is the same TCP connection, the IDs of streams are different. What is the problem here?
You're not advertising support for resource binding, so the client can't complete the session setup. It seems Pidgin decides then to fall back on jabber:iq:auth (pre-XMPP style) if the server doesn't support XMPP-style stream setups.
You'll want to take a look at https://www.rfc-editor.org/rfc/rfc6120#section-7 as "Support for resource binding is REQUIRED in XMPP client and server implementations." and "The parties to a stream MUST consider resource binding as mandatory-to-negotiate."
While implementing XMPP by looking at what other implementations do, rather than following the specs, is not a good idea, sometimes taking a glance at another implementation's stream can give a clue when you get stuck like this.
I'm working on getting Jappix running. I'm using ejabberd as my XMPP server and I've got everything working except comments and viewing attachments - group chat, single chat, external authentication, private messages, friend lists, presence and other works as intended.
My configuration is the same as the one the Jappix project provides on their jappix/jappix-tools github repository. I have no errors in my ejabberd log, the only thing I got while debugging and digging everything up is that this is an example stanza sent to the server:
<iq xmlns="jabber:client" type="get" id="get_31-30" to="pubsub.mydomain.com" xml:lang="en">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<items node="urn:xmpp:microblog:0:comments/3aca5f972fe7198805bdd1a20f502f35"/>
</pubsub>
</iq>
And this is the response I get from the server:
<iq xmlns="jabber:client" from="pubsub.mydomain.com" to="arqu#mydomain.com/jappix (1378149270017)" type="error" id="get_31-30" xml:lang="en" xmlns:xml="http://www.w3.org/XML/1998/namespace">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<items node="urn:xmpp:microblog:0:comments/3aca5f972fe7198805bdd1a20f502f35"/>
</pubsub>
<error code="503" type="cancel">
<service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>
And in Jappix I just get the usual "Service Unavailable" error message.
Additional info:
My BOSH is the internal one of ejabberd and works fine as far as i know, I've setup the reverse proxy and everything else to make it work. Still could be something related to this and not reaching the service on some other port maybe?
It looks like you do not have pubsub enabled/installed on your server.
Have you tried any other pubsub request?
I am working on a iOS chat application, so for media transfer to work i need to enable mod_proxy65, and i have enabled the same in ejabberd.cfg file with their default setting: {mod_proxy65[]}. on client side i am using the https://github.com/robbiehanson/XMPPFramework xmpp framework for iOS.
in TURNSocket.m i have used proxy candidate as dev.myserver.com in place of default jabber.org . now when I try to open the TURN connection, the series of iq received and sent are as follows:
SEND: <iq type="get" to="dev.myserver.com" id="A9876DD0-B13C-4DC7-B812-2A6E653288BC"><query xmlns="http://jabber.org/protocol/disco#items"/></iq>
RECV: <iq xmlns="jabber:client" from="dev.gungroo.com" to="smita#dev.myserver.com/24983171131368877324197828" id="A9876DD0-B13C-4DC7-B812-2A6E653288BC" type="result"><query xmlns="http://jabber.org/protocol/disco#items"><item jid="conference.dev.myserver.com"/><item jid="irc.dev.myserver.com"/><item jid="proxy.dev.myserver.com"/><item jid="pubsub.dev.myserver.com"/><item jid="vjud.dev.myserver.com"/></query></iq>
SEND: <iq type="get" to="proxy.dev.myserver.com" id="26D694FB-C679-478C-A3D1-A84B9A583534"><query xmlns="http://jabber.org/protocol/disco#info"/></iq>
RECV: <iq xmlns="jabber:client" from="proxy.dev.myserver.com" to="smita#dev.myserver.com/24983171131368877324197828" id="26D694FB-C679-478C-A3D1-A84B9A583534" type="result"><query xmlns="http://jabber.org/protocol/disco#info"><identity category="proxy" type="bytestreams" name="SOCKS5 Bytestreams"/><feature var="http://jabber.org/protocol/disco#info"/><feature var="vcard-temp"/><feature var="http://jabber.org/protocol/bytestreams"/><x xmlns="jabber:x:data" type="result"><field var="FORM_TYPE" type="hidden"><value>http://jabber.org/network/serverinfo</value></field></x></query></iq>
SEND: <iq type="get" to="proxy.dev.myserver.com" id="C60068A2-985C-4C5C-87B3-C9FFFB41FDF0"><query xmlns="http://jabber.org/protocol/bytestreams"/></iq>
RECV: <iq xmlns="jabber:client" from="proxy.dev.gungroo.com" to="smita#dev.myserver.com/24983171131368877324197828" id="C60068A2-985C-4C5C-87B3-C9FFFB41FDF0" type="result"><query xmlns="http://jabber.org/protocol/bytestreams"><streamhost jid="proxy.dev.myserver.com" host="10.212.103.159" port="7777"/></query></iq>
here is the problem, its returning me the internal ip address(10.212.103.159) of server dev.myserver.com, resulting in failure of making the TURN connection. why doesn't it return external ip address of proxy.dev.myserver.com ?
to be on the same page: proxy.dev.myserver.com and dev.myserver.com both points to same external ip. and the port 7777 is open at my server dev.myserver.com . anybody who have worked with the same, please help??
here is the last iq(sent and received) which shows the error message:
SEND
<iq type="set" to="smita1#dev.myserver.com/38303823331368691199448799" id="2D376DBF-D437-48C8-B0FF-B10A5CD73240">
<query xmlns="http://jabber.org/protocol/bytestreams" sid="2D376DBF-D437-48C8-B0FF-B10A5CD73240" mode="tcp">
<streamhost xmlns="http://jabber.org/protocol/bytestreams" jid="proxy.dev.myserver.com" host="10.212.103.159" port="7777"/>
</query>
</iq>
RECV
<iq xmlns="jabber:client" from="smita1#dev.myserver.com/38303823331368691199448799" to="smita#dev.myserver.com/278621573136869119737843" type="error" id="2D376DBF-D437-48C8-B0FF-B10A5CD73240">
<query xmlns="http://jabber.org/protocol/bytestreams" sid="2D376DBF-D437-48C8-B0FF-B10A5CD73240" mode="tcp">
<streamhost xmlns="http://jabber.org/protocol/bytestreams" jid="proxy.dev.myserver.com" host="10.212.103.159" port="7777"/>
</query>
<error type="cancel" code="501">
<feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>
it would be really great if someone can point me to the problem. Thanks!
This helped me to resolve the issue. xx.xx.xx.xx is my external ip:
{mod_proxy65, [{hostname, ["xx.xx.xx.xx"]}]},
Visit this ,I can give an idea [XMPPFramework - TURNSocket can't receive the data that sent by myself? ]
Also [http://xmpp.org/extensions/xep-0096.html],[ XMPP Sending/Receving file in iphone sdk ...? ]
I have an XEP-0114 based XMPP component that works fine with the Openfire server. Ejabberd however complains about it.
First thing it does (after having authenticated) is to indicate presence. It does so by sending this:
<presence from="tictactoe.komogvind.dk"/>
I get this reply
<presence type="error" to="tictactoe.komogvind.dk" xmlns:stream="http://etherx.jabber.org/streams">
<error code="400" type="modify">
<bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</presence>
What am I missing?