Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
huanghucheng #1
Member since Sep 2011 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: AuthError: when using a email address to register
hello,Alex,when I use a email address to register,then it will return a AuthError. my example:aaa&163.com@127.0.0.1
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Please post a the complete xml debug of your registration.
And be aware that the @ in usernames is invalid and must escaped, see XEP-0106: JID Escaping.

Alex
Avatar
huanghucheng #3
Member since Sep 2011 · 8 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #1
here is it:
SEND: <iq id="agsXMPP_1" type="get" to="127.0.0.1"><query xmlns="jabber:iq:register" /></iq>
RECV: <iq xmlns="jabber:client" from="127.0.0.1" type="result" id="agsXMPP_1"><query xmlns="jabber:iq:register"><username /><password /><email /><name /><x xmlns="jabber:x:data" type="form"><title>XMPP Client Registration</title><instructions>Please provide the following information</instructions><field type="hidden" var="FORM_TYPE"><value>jabber:iq:register</value></field><field type="text-single" label="Username" var="username"><required /></field><field type="text-single" label="Full name" var="name" /><field type="text-single" label="Email" var="email" /><field type="text-private" label="Password" var="password"><required /></field></x></query></iq>
SEND: <iq type="set" id="agsXMPP_2" to="127.0.0.1"><query xmlns="jabber:iq:register"><username>aa\40a</username><password>12345</password></query></iq>
RECV: <iq xmlns="jabber:client" from="127.0.0.1" to="127.0.0.1/de3427c" type="result" id="agsXMPP_2" />
SEND: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5" />
RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09IjEyNy4wLjAuMSIsbm9uY2U9IjBPby9iYnlIQVdDSGtzUXhTZEdKNEo0ZzFYMzBTZDgwUkkxMExzdC8iLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>
SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9ImFhXDQwYSIscmVhbG09IjEyNy4wLjAuMSIsbm9uY2U9IjBPby9iYnlIQVdDSGtzUXhTZEdKNEo0ZzFYMzBTZDgwUkkxMExzdC8iLGNub25jZT0iMDU5NjhlNGI4ODg2MzI2NzNkOGEyY2IwNjM5YjdmMDNjY2ZiYjRjZGVlZTllMmEzNWUzY2E0MzM1ODM4NTUxMiIsbmM9MDAwMDAwMDEscW9wPWF1dGgsZGlnZXN0LXVyaT0ieG1wcC8xMjcuMC4wLjEiLGNoYXJzZXQ9dXRmLTgscmVzcG9uc2U9YTUxZmVlZDBkZGY1YmFjMDU1ZjIwMzE4ODFkZmUzYjc=</response>
RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized /></failure>
I have red the XEP-0106: JID Escaping.it show me that when I use @ in the username,I must transfer it into \40.But I did it and it did not work.
            _connection.Server = "127.0.0.1";
            string userName = txtJid.Text;
            userName = userName.Replace("@","\\40");
            _connection.Username = userName;
       _connection.Password = txtPassword.Text;
Do you think i need to modify the agsxmpp source code ? or could you tell me how to modify it?
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  • Please post the complete log of the session.
  • You use an IP address as XMPP domain which is bad, you should use a domain.
  • The Jid class in agsXMPP supports XEP-0106 Jid Escaping. You don't have to change the code, just use the Jid class.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS