OpenFire in-band registration (XEP-0077): <stream:features> does not contain register tag, even though in-band registration is enabled

I am running an openfire server on the Amazon Web Services EC2 cloud and have written a little strophe.js powered xmpp client to connect to the server and send messages back and forth. This works fine.

However, I also want to do in-band registration (XEP-0077) with this client. For this, I am trying to use strophe.register.js.

Here is the code I use:

var tempConn = new Strophe.Connection("myAWSDNS.compute.amazonaws.com:7070/http-bind/"); tempConn.register.connect("[http://myAWSDNS.us-west-2.compute.amazonaws.com/](http://myAWSDNS.us-west-2.compute.amazonaws.com/)", function (status) { if (status === Strophe.Status.REGISTER) { // fill out the fields connection.register.fields.username = "juliet"; connection.register.fields.password = "R0m30"; // calling submit will continue the registration process connection.register.submit(); } else if (status === Strophe.Status.REGISTERED) { console.log("registered!"); // calling login will authenticate the registered JID. connection.authenticate(); } else if (status === Strophe.Status.CONFLICT) { console.log("Contact already existed!"); } else if (status === Strophe.Status.NOTACCEPTABLE) { console.log("Registration form not properly filled out.") } else if (status === Strophe.Status.REGIFAIL) { console.log("The Server does not support In-Band Registration") } else if (status === Strophe.Status.CONNECTED) { // do something after successful authentication } else { // Do other stuff } });

I have enabled in-band registration on the openfire server (see image)

However, I always get output: “The Server does not support In-Band Registration” (i.e., status === Strophe.Status.REGIFAIL.

I have stepped into strophe.register.js code, and see that it tries to find the register-tag in the <stream:features>, but cant find it, and sets the status to REGIFAIL then.

var register, mechanisms; register = bodyWrap.getElementsByTagName("register"); mechanisms = bodyWrap.getElementsByTagName("mechanism"); if (register.length === 0) { that._changeConnectStatus(Strophe.Status.REGIFAIL, null); return;

<body xmlns="[http://jabber.org/protocol/httpbind](http://jabber.org/protocol/httpbind)" xmlns:stream="[http://etherx.jabber.org/streams](http://etherx.jabber.org/streams)" from="win-lv4k7bsupjo" authid="747df9ee" sid="747df9ee" secure="true" requests="2" inactivity="30" polling="5" wait="60" hold="1" ack="913534085" maxpause="300" ver="1.6"><stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="[http://jabber.org/features/compress](http://jabber.org/features/compress)"><method>zlib</method></compression><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></stream:features></body>

As you can see it contains a bunch of mechanisms, but no register part.

So, my question is: Why does it not contain a register tag, if I have enabled in-band registration, and, how can I set it to include this register tag, so I can do in-band registration?

Any help is appreciated!

Thanks,

best regards,

Chris

Yes, indeed. It seems to be a BOSH issue. In the normal stream it is included:

<stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from="…" id=“d961cb38” xml:lang=“de” version=“1.0”>stream:featuresPLAINANONYMOUSCRAM-MD5DIGEST-MD5</mech anism>zlib</stream:features>

Bug tracked as OF-840

1 Like

Hey csh, thanks for your response. I saw that the bug has been given a “major” priority. Given this, I would assume, if it is not too hard to fix, it will be in one of the next releases. How often, more or less, are releases done, so I can estimate when this will work?

Thanks,

br, chris

Cool, I see its been fixed. That’s awesome, thanks csh! Looking forward to next nightly build!

Cheers,

Chris

You’re welcome!

“Major” is just the default priority. Most issues are major (although they should rather be minor). There are unfixed issues, that are many years old and never made it into a release.

But this time, you are lucky :-).

About the release cycle: In the past, a release was approximately done twice a year or even more rarely. There were years with no Openfire release at all (2010, 2012). You should ask Dave Cridland (the lead) about the next release.

Is there a way to overcome this issue until the next release?

I don’t think so. You could do without BOSH or “hardcode” in your client, that XEP-0077 is supported.

By "hardcode the client"you mean foo strophe to ignore status.REGIFIL ?

I don’t know strophe, but basically I mean to trick it, i.e. ignore the supported stream features and simply assume that the server supports XEP-0077.