Jos I. Boumans wrote:
Hi,the usernames we use in our database can contain dashes. When i tried to authenticate against djabberd using one of those usernames, I found that authentication just hangs.This led me to check in the following fixme (locally only right now) in DJabberd::IQ:495# XXX FIXME # if a username contains \W, we return here and the client is left # hanging in authentication state. We should at least send back # an error/reject of some sort --kane return unless $username =~ /^\w+$/;But, looking at the Jabber spec[1], it seems that pretty much most characters canbe used as part of the JID:
Correct. In fact the username portion of a JID can allow just about any Unicode character.
<conforming-char> ::= #x21 | [#x23-#x25] | [#x28-#x2E] | [#x30-#x39] | #x3B | #x3D | #x3F | [#x41-#x7E] | [#x80-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
You got that here: http://www.xmpp.org/extensions/xep-0029.htmlHowever that spec was superseded by RFC 3920, which in turn will be superseded by rfc3920bis. See the following links for the most accurate and up-to-date definition:
http://www.xmpp.org/internet-drafts/draft-saintandre-rfc3920bis-06.html#addressing-node http://www.xmpp.org/internet-drafts/draft-saintandre-rfc3920bis-06.html#nodeprep
A quick hack to add '-' to be supported showed me I had to change the code in3 places in IQ.pm[2], but other than that, everything worked as expected.Is there any reason DJabberd is overly restrictive?
Perhaps because "-" was not allowed in Live Journal usernames? /psa
smime.p7s
Description: S/MIME Cryptographic Signature