username validation while creating a new user in EJabberd server

Hi All,

Please suggest, if it is possible to make email-id (like abc@test.com) as username while creating a new account in my Ejabberd server, I am using smack client apis and getting Bad request(400) while doing above.

Username cannot contain @

kamaljoshi wrote:

Hi All,

Please suggest, if it is possible to make email-id (like abc@test.com) as username while creating a new account in my Ejabberd server, I am using smack client apis and getting Bad request(400) while doing above.

XMPP-Core -> Addresses

Quote:
   jid             = [ node "@" ] domain [ "/" resource ]
   node            = 1*(nodepoint)
                     ; a "nodepoint" is a UTF-8 encoded Unicode code
                     ; point that satisfies the Nodeprep profile of
                     ; stringprep

A node identifier MUST be formatted such that the Nodeprep profile of [STRINGPREP] can be applied without failing (see Appendix A).

Appendix A. Nodeprep -> A.5. Prohibited Output

In addition, the following additional Unicode characters are also prohibited:
        U+0022 (QUOTATION MARK) 
        U+0026 (AMPERSAND) 
        U+0027 (APOSTROPHE) 
        U+002F (SOLIDUS) 
        U+003A (COLON) 
        U+003C (LESS-THAN SIGN) 
        U+003E (GREATER-THAN SIGN) 
        U+0040 (COMMERCIAL AT) 

And the prohibited U+0040 (COMMERCIAL AT) is what you wanted to use: @

It seems XMPP-Core allows in a username the characters # and %, for example. Maybe you can use those characters: abc%test.com@jabber.example.org.

Thanks

Thanks for your reply...

Syndicate content