Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Trouble authenticating with openfire via localhost
Avatar
jessicablue #1
Member since Apr 2011 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: OpenFire Localhost Authentication Issue
Hi,

I'm having trouble authenticating with openfire via localhost. At first I was getting an auth error, but after I set 'xmpp.fqdn' to '127.0.0.1' in openfire the auth error went away; though, now I have a 400 error.  Below is the source and xml output:

Any help clearing up this issue is very much appreciated!

-Jess


            ILogger logger = new ConsoleLogger();

            m_xmppClient = new XmppClientConnection();

            Jid jid = new Jid("jessica@127.0.0.1");
            m_xmppClient.Server = jid.Server;
            m_xmppClient.Username = jid.User;
            m_xmppClient.Password = "password";
            m_xmppClient.Port = 5222;
        
            //m_xmppClient.UseStartTLS = true;
            //m_xmppClient.ConnectServer = "jabber";  //doesn't work when enabled for some reason...
           
            m_xmppClient.AutoResolveConnectServer = true;  //what is this for?
            m_xmppClient.Open();
           
            m_xmppClient.OnLogin += delegate(Object o)
            {
                logger.Info("LOGGED IN");
                m_xmppClient.Send(new Message("blue", agsXMPP.protocol.client.MessageType.chat, "Hi!"));
            };
            m_xmppClient.OnError += delegate(Object sender, Exception ex)
            {
                logger.Info("ERROR: " + ex.ToString());
            };
            m_xmppClient.OnAuthError += delegate(Object sender, agsXMPP.Xml.Dom.Element e)
            {
                logger.Info("AUTH ERROR: " + e.ToString());
            };
            m_xmppClient.OnClose += delegate(Object sender)
            {
                logger.Info("CONNECTION CLOSED");
            };
            m_xmppClient.OnXmppConnectionStateChanged += delegate(Object sender, XmppConnectionState state)
            {
                logger.Info("STATE: " + state.ToString());
            };
            m_xmppClient.OnWriteSocketData += delegate(object sender, byte[] data, int count)
            {
                logger.Info("WRITE: " + System.Text.Encoding.Default.GetString(data, 0, count));
            };
            m_xmppClient.OnReadSocketData += delegate(object sender, byte[] data, int count)
            {
                logger.Info("READ: " + System.Text.Encoding.Default.GetString(data, 0, count));
            };
            m_xmppClient.OnSaslStart += delegate(object sender, SaslEventArgs args)
            {
                logger.Info("ON_SASL_START");
                //not working
                args.Mechanism =
                agsXMPP.protocol.sasl.Mechanism.GetMechanismName(agsXMPP.protocol.sasl.MechanismType.PLAIN);
            };



********************
4/12/2011 4:33:01 PM
Log Level: Info

STATE: Connected
********************



********************
4/12/2011 4:33:01 PM
Log Level: Info

WRITE: <stream:stream to='127.0.0.1' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
********************



********************
4/12/2011 4:33:01 PM
Log Level: Info

READ: <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="jabber" id="170d96f4" xml:lang="en" version="1.0">
********************



********************
4/12/2011 4:33:01 PM
Log Level: Info

READ: <stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"></starttls><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</m'xmppconnection-ui.vshost.exe' (Managed (v4.0.30319)): Loaded 'Z:\sunset\firefly\xmppconnection-ui\bin\Debug\crypto.dll'
ethod></compression><auth xmlns="http://jabber.org/features/iq-auth"/><register xmlns="http://jabber.org/features/iq-register"/></stream:features>
********************



********************
4/12/2011 4:33:01 PM
Log Level: Info

STATE: Securing
********************



********************
4/12/2011 4:33:01 PM
Log Level: Info

WRITE: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
********************



********************
4/12/2011 4:33:01 PM
Log Level: Info

READ: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
********************



********************
4/12/2011 4:33:01 PM
Log Level: Info

WRITE: <stream:stream to='127.0.0.1' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
********************



********************
4/12/2011 4:33:01 PM
Log Level: Info

STATE: Authenticating
********************



********************
4/12/2011 4:33:01 PM
Log Level: Info

READ: <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="jabber" id="170d96f4" xml:lang="en" version="1.0"><stream:features><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/12/2011 4:33:01 PM
Log Level: Info

ON_SASL_START
********************



********************
4/12/2011 4:33:01 PM
Log Level: Info

WRITE: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5" />
********************



********************
4/12/2011 4:33:01 PM
Log Level: Info

READ: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09IjEyNy4wLjAuMSIsbm9uY2U9ImNNbENPWU5vRlhFTmc1NGRDaFdYVFNBcWFUR2ZGRnhvb3RwL0tMazciLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>
********************



********************
4/12/2011 4:33:02 PM
Log Level: Info

WRITE: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9Implc3NpY2EiLHJlYWxtPSIxMjcuMC4wLjEiLG5vbmNlPSJjTWxDT1lOb0ZYRU5nNTRkQ2hXWFRTQXFhVEdmRkZ4b290cC9LTGs3Iixjbm9uY2U9IjAyNzU1NGE4NDcyMjgyOThhOTUyZDdlMzM2NTRiZGU0MTJlNTdkMDk3Y2EyYWYxZGVkYmRmNGU3M2Y4MzFiZjIiLG5jPTAwMDAwMDAxLHFvcD1hdXRoLGRpZ2VzdC11cmk9InhtcHAvMTI3LjAuMC4xIixjaGFyc2V0PXV0Zi04LHJlc3BvbnNlPWYxMzE1MzMwMzY3NGRlNGY4NzUxMjFkZWE1NGU3ZmUz</response>
********************



********************
4/12/2011 4:33:02 PM
Log Level: Info

READ: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cnNwYXV0aD00YWYzYjhhOWU2YWRmNThhMTU2ZDRjOGM0MGY2YzU1YQ==</success>
********************



********************
4/12/2011 4:33:02 PM
Log Level: Info

STATE: Authenticated
********************



********************
4/12/2011 4:33:02 PM
Log Level: Info

WRITE: <stream:stream to='127.0.0.1' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
********************



********************
4/12/2011 4:33:02 PM
Log Level: Info

READ: <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="jabber" id="170d96f4" xml:lang="en" version="1.0"><stream:features><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></stream:features>
********************



********************
4/12/2011 4:33:02 PM
Log Level: Info

STATE: Binding
********************



********************
4/12/2011 4:33:02 PM
Log Level: Info

WRITE: <iq id="agsXMPP_1" type="set" to="127.0.0.1"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>agsXMPP</resource></bind></iq>
********************



********************
4/12/2011 4:33:02 PM
Log Level: Info

READ: <iq type="error" id="agsXMPP_1" from="127.0.0.1" to="jabber/170d96f4"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>agsXMPP</resource></bind><error code="400" type="modify"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>
********************
Avatar
jessicablue #2
Member since Apr 2011 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Fixed... but I still don't know why I can't change the mechanism
            Jid jid = new Jid("jessica@jabber");
            m_xmppClient.Server = jid.Server;
            m_xmppClient.Username = jid.User;
            m_xmppClient.Password = "password";
            m_xmppClient.Port = 5222;
            m_xmppClient.AutoResolveConnectServer = false;
            //m_xmppClient.UseStartTLS = true;
            m_xmppClient.ConnectServer = "127.0.0.1";
Avatar
Alex #3
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
WRITE: <stream:stream to='127.0.0.1' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>

READ: <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="jabber" id="170d96f4" xml:lang="en" version="1.0">
********************

the 2 attributes which I marked at the beginning of your log is the XMPP domain. And those must match. They don't match in your logfile.

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