Connection refused as unauthenticated

I had a very nice implementation of code that relied on smack 2.x and jaxb2.0 which worked. But it stopped working, and I am trying to upgrade ti to smack 3.04.

Some things have changed. Before there was no XMPPConnection.connect() method, and there was an explicit method to turn on TLS (which I think is the default). But now when I do the connect() method, the server (SoapBox) rejects the connection syaing “NotAuthorizedStreamException. Stream not authenticated.” This is before the login() request.

How do I authenticate the stream? What causes this?

Here is the code:

ConnectionConfiguration cc = new ConnectionConfiguration (xmpp_server, 5222);

cc.setSecurityMode(ConnectionConfiguration.SecurityMode.enabled);

cc.setSASLAuthenticationEnabled (true);

fConn = new XMPPConnection (cc);

//###JAR connect to the server

fConn.connect();

The connection is rejected at this point!

The smack debugger gives me

(sent)

<stream:stream to=“bragg07” xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” version=“1.0”>

<auth mechanism=“PLAIN” xmlns=“urn:ietf:params:xml:ns:xmpp-sasl”>AGphci5zb2Z0d2FyZQBnejRocUA3bQ==&lt ;/auth>

<presence id=“ES9x4-0” type=“unavailable”></presence>

</stream:stream>

(returned)

<stream:stream from=“bragg07” xml:lang=“en-us” id=“64cbaaae-d474-44d2-bc68-c07550325326” xmlns=“jabber:client” version=“1.0” xmlns:stream=“http://etherx.jabber.org/streams”><stream:features xmlns:stream=“http://etherx.jabber.org/streams”><register xmlns=“http://jabber.org/features/iq-register” /><auth xmlns=“http://jabber.org/features/iq-auth” /><mechanisms xmlns=“urn:ietf:params:xml:ns:xmpp-sasl”><mechanism>PLAIN</mechanis m><mechanism>DIGEST-MD5</mechanism></mechanisms></stream :features>

<failure xmlns=“urn:ietf:params:xml:ns:xmpp-sasl”><not-authorized /></failure>

Why isn’t it using TLS?

Solved this. The SoapBox server requires the user ID always have @server affixed to it. OpenFire does not seem to require this.