Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Can't login to openfire server using my app, but other xmpp clients can connect using the same username and password
Page:  1  2  next
Avatar
xhowl #1
Member since Feb 2010 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: Can't authenticate to openfire server
Hi,
Ive been trying to connect to an openfire server but it always says “Invalid username/password.
I have tried the same username and password on spark and pandion and they both work.
Here’s the connection properties i set in my app
_con.Server = "xmpp.openfire-server.com";
_con.Resource = “My App”;
_con.Port = 5222;
_con.Priority = 10;

_con.UseSSL = false;
_con.UseStartTLS = true;

_con.Username = “chris”;
_con.Password = “password”;
_con.open;

Connecting using Pandion
Address: chris@openfire-server.com
Password: “password”
-Server Connection settings-
    Address: xmpp.openfire-server.com
    Port: Automatic

Login is successful

Connecting using Spark
Username: chris
Password: “password”
Server: xmpp.openfire-server.com

Login is successful

I tried using MiniClient with the following connection properties
Username: chris@openfire-server.com
Password: “password”
Port = 5222
Priority = 10

When i try to login, a messagebox shows “Socket Error No connection could be made because the target machine actively refused it 111.111.111.111:5222”.
And there are no debug data.


I tried Miniclient again with a different username
Username: chris@xmpp.openfire-server.com
Password: “password”
Port=5222
Priority =10

When i try to login, a messsagebox shows “Authentication Error! Wrong password or username:
Debug data:

SEND: <stream:stream to='xmpp.openfire-server.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="openfire-server.com" version="1.0" xml:lang="en" id="a3f988a6" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" /><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth" /></stream:features>
SEND: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
SEND: <stream:stream to='xmpp.openfire-server.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="openfire-server.com" version="1.0" xml:lang="en" id="a3f988a6" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth" /></stream:features>
SEND: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5" />
RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09ImNvbW11bmktc2FmZS5jb20iLG5vbmNlPSI2UXF1eVd0eThXSzd5aDZiSHBBU3dzSjJ0MEplWmx1aW04YzB4M21TIixxb3A9ImF1dGgiLGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz</challenge>
SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9ImNocmlzIixyZWFsbT0iY29tbXVuaS1zYWZlLmNvbSIsbm9uY2U9IjZRcXV5V3R5OFdLN3loNmJIcEFTd3NKMnQwSmVabHVpbThjMHgzbVMiLGNub25jZT0iZGNkNjRjMjg2ODllOWYxMDE1NTcwNjU1Y2ExNWVkODdlNzQxMDEyNmRiMjk3YzA1MjQ3MDliN2MyZTIwM2NhNCIsbmM9MDAwMDAwMDEscW9wPWF1dGgsZGlnZXN0LXVyaT0ieG1wcC94bXBwLmNvbW11bmktc2FmZS5jb20iLGNoYXJzZXQ9dXRmLTgscmVzcG9uc2U9NzQ1MDFkMzJhY2U0YmFhZGM4OGUwM2RiMWYxZWIyZGM=</response>
RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized /></failure>
SEND: </stream:stream>
RECV: </stream:stream>


Cant figure it if there is something wrong with the code or there’s something wrong with the openfire server. Point me to the right direction.

Thanks,
Chris
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Username is everything before the @ in the JabberId
Server is everything after the @ in the JabberId.

If you still get auth errors then your server is configured wrong. Probably the Xmpp Domain. This question came up here several times before.

Alex
Avatar
JustinCase #3
Member since Apr 2010 · 2 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex,

I am working with Xhowl (who started the thread).  Let me please give some more information in the hopes you might be able to pinpoint what we are doing wrong..

Server = Openfire 3.6.4

Domain name = abc.com

DNS pointing to this server = xmpp.abc.com

In the openfire server, we have:  xmpp.domain = abc.com

We have searched and read the posts here, but simply cannot see what we are doing wrong.

Thanks again..

Michael
Avatar
JustinCase #4
Member since Apr 2010 · 2 posts
Group memberships: Members
Show profile · Link to this post
Solution

I wanted to post the solution here in case it helps anyone else.

Although our code specified to use xmpp.abc.com, it seems that the IM server must be the same as the domain itself.  In other words, in DNS, abc.com and xmpp.abc.com did not point to the same location.

We pointed abc.com (in DNS) to teh same location as our XMPP server, changed the string from xmpp.abc.com to just abc.com, and it works fine.

Regards,

Michael
Avatar
Alex #5
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi Michael,

we use SRV records in XMPP to avoid these problems.
If you set the correct XMPP SRV records for the domain abc.com our libraries will find your server automatically.


Another solution is set AutoResolveConnectServer to false and specify the domain or IP of the XMPP server manual in the ConnectServer property. But the first solution with SRV records is how it should be done correctly in XMPP.

Alex
Avatar
Nenad #6
Member since May 2010 · 4 posts
Group memberships: Members
Show profile · Link to this post
Hi,
I'm having the same problem - can't authenticate my client designed using agsXMPP library to the OpenFire server.

Upon executing xmppConn.Open() I do get the "Connected" status for the XmppConnectionState , but never the "Authenticated" property set to TRUE, no matter how long do I let the program wait in the loop. I tried with AutoResolveConnectServer set to both true and FALSE, and using the XMPP server IP and Domain name for the xmppConn.Server property.

Can you be more precise in what needs to be set up on the server side so the authentication works? What exactly are "XMPP SRV records" and where do I set them up?

Thank you.

Nenad
Avatar
Nenad #7
Member since May 2010 · 4 posts
Group memberships: Members
Show profile · Link to this post
I forgot to mention, when I use the "Spark" client software (chatt application developed by the same company as OpenFire server), I can connect and login just fine, using the same user account.

This is just to confirm that the user accounts are set up properly, the server is "on" and "visible" from the outside.


thanks
Avatar
Alex #8
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
can you please post the Xml log and provide me a test account on your public server?
Please post also the data you use to establish the connection (username, server ...)

Alex
Avatar
Nenad #9
Member since May 2010 · 4 posts
Group memberships: Members
Show profile · Link to this post
here is the test account created for you:
u: alex
p: testme
server: xmppt.boardreader.com



and here is the log from my testing:


  1. <stream:stream to='xmppt.boardreader.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
  2. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="xmppt" version="1.0" xml:lang="en" id="561d492d" >
  3. <stream:features xmlns:stream="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" /><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth" /><register xmlns="http://jabber.org/features/iq-register" /></stream:features>
  4. <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5" />
  5. <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09InhtcHB0Iixub25jZT0iUDN0TUZoV1hPSjlnZjRFTFRDc2Jac1ZxT3Flby9KWnlOQmtyakI0aiIscW9wPSJhdXRoIixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzcw==</challenge>
  6. <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9ImlkZW50aWNhZmVlZCIscmVhbG09InhtcHB0Iixub25jZT0iUDN0TUZoV1hPSjlnZjRFTFRDc2Jac1ZxT3Flby9KWnlOQmtyakI0aiIsY25vbmNlPSI0ZjQ2MjM4OGIyY2YxNTJhMDU2YzI3MDk0MDc0MDczOWE4YmQzZWZjNmZlZDUwY2JiZGMzZmQ2MTk4OTZkNDExIixuYz0wMDAwMDAwMSxxb3A9YXV0aCxkaWdlc3QtdXJpPSJ4bXBwL3htcHB0LmJvYXJkcmVhZGVyLmNvbSIsY2hhcnNldD11dGYtOCxyZXNwb25zZT0wMTNhYzRiOTVkOTRjNDUxOGRlZGY4Nzc2ZmNjOTVlMA==</response>
  7. <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized /></failure>
  8. </stream:stream>

thanks.
This post was edited on 2010-05-17, 16:53 by Alex.
Avatar
Alex #10
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you server is configured to the domain xmppt not xmppt.boardreader.com. This is why the authentication fails.

Alex
Avatar
Nenad #11
Member since May 2010 · 4 posts
Group memberships: Members
Show profile · Link to this post
that was it!

thank you very much, Alex.
Avatar
yopy_yogie #12
Member since Jun 2010 · 8 posts
Group memberships: Members
Show profile · Link to this post
I have similar problem using MiniClient. The application says "Authentication Error, wrong password and/or username".
I have try using ConnectServer and set AutoResolveConnectServer to false, but still can not connect.

UserName : jabberd1@spc-ubuntu
ConnectServer : spc-ubuntu

Below is debug log :

SEND: <stream:stream to='spc-ubuntu' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="spc-ubuntu" version="1.0" xml:lang="en" id="6bac6dc6" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms></stream:features>
SEND: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
SEND: <stream:stream to='spc-ubuntu' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="spc-ubuntu" version="1.0" xml:lang="en" id="6bac6dc6" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth" /></stream:features>
SEND: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5" />
RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09InNwYy11YnVudHUiLG5vbmNlPSJYZVZoMUo4MHc3NWY0bm40MFZnOXRROWNRRXljcEJONWZpNDlaZUNkIixxb3A9ImF1dGgiLGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz</challenge>
SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9ImphYmJlcmQxXDQwc3BjLXVidW50dSIscmVhbG09InNwYy11YnVudHUiLG5vbmNlPSJYZVZoMUo4MHc3NWY0bm40MFZnOXRROWNRRXljcEJONWZpNDlaZUNkIixjbm9uY2U9IjJhYmUwMGJhN2VjYjAyMTE1YWVkMTY4MGU4MTU1ZjRhMWYzODdiMTc4MmY4ZThhNWRlNGY4NjMyNzk0YzVhZDgiLG5jPTAwMDAwMDAxLHFvcD1hdXRoLGRpZ2VzdC11cmk9InhtcHAvc3BjLXVidW50dSIsY2hhcnNldD11dGYtOCxyZXNwb25zZT00NWQ5ZDVkMTUxZGNkOTJjYzNkZmM2YWRhNzc2ODgxMg==</response>
RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized /></failure>
SEND: </stream:stream>
RECV: </stream:stream>

Please help.

Regards
Avatar
Alex #13
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
what is the Openfire XMPP domain?
Look at my attached screenshot where you can find it.

Alex
The author has attached one file to this post:
xmpp_domain_openfire.png 59.4 kBytes
You have no permission to open this file.
Avatar
yopy_yogie #14
Member since Jun 2010 · 8 posts
Group memberships: Members
Show profile · Link to this post
The domain is spc-ubuntu ....
Avatar
Alex #15
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
your username is wrong because it includes the domain. The correct username is jabberd1 in your case.

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:
Page:  1  2  next
Forum: agsXMPP RSS