A note on error messages
Various errors can occur during user registration. They are, on the whole, fairly plain and easy to understand. But because of the way the server has been written, you might be surprised at what error message you receive in certain circumstances.
Because the required fields <username/>
and <password/> are checked
before looking
to see whether or not there is a <register/>
section in the JSM instance configuration, you will always receive a
406 “Not Acceptable” instead of a
501 “Not Implemented” if you don’t supply those
fields, even if the registration mechanism has been turned off.
Likewise, if you specify a username that already exists, you will receive a 409 “Username Not Available” instead of a 501 “Not Implemented.”
Of course, if you do an IQ-get with the
jabber:iq:register namespace beforehand, you
will receive the “correct” error—good
practice pays!
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access