I’'m building an application which will utilise existing usernames which unfortunately do not adhere to the XMPP node character set. Therefore I have decided to escape the illegal characters so that a maps to \20 etc.
Now, I create the user accounts on the server and all is well. When I try to log in to the server the login details cannot be found and login is unsuccessful. I have managed to trace it down to the fact that the server is storing the username as an escaped form of the already escaped username.
We need to setup an account on our server for user “I love spaces”
We create XMPP account on Openfire “I\20love\20spaces”
This is stored in the DB as “I\5c20love\5c20spaces”
When we try to login with username “i\20love\20spaces” (I control the client so its okay) Openfire queries the db with a re-escaped username “I\5c20love\5c20spaces” against unescaped usernames “I\20love\20spaces” and login is unsuccesful.
Any ideas of how this can be solved? I’‘ve had a look at the XMPP JID spec and am pretty sure that the way I’'ve escaped this is okay.