title: Trying to log into XMPP server using Smack results in SASL "not authorized"
body: <p>I'm trying to use Smack to log into a XMPP server. When trying to login I get the following Error :</p>
  
  <blockquote>
    <p>SASL authentication PLAIN failed: not-authorized</p>
  </blockquote>
  
  <p>I have been able to connect and log into the server using PSI-IM with the same credentials.</p>
  
  <p>This is what I currently have :</p>
  
  <pre><code>    System.setProperty("smack.debugEnabled", "true");
      XMPPConnection.DEBUG_ENABLED = true;
  
      SASLAuthentication.supportSASLMechanism("PLAIN", 0);
  
      ConnectionConfiguration configuration = new ConnectionConfiguration("chat.bla.com", 5223);
      configuration.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
      configuration.setSocketFactory(new DummySSLSocketFactory());
      configuration.setSASLAuthenticationEnabled(true);
      configuration.setDebuggerEnabled(true);
      configuration.setServiceName("bla.net");
  
      Connection connection = new XMPPConnection(configuration);
  
      try {
          connection.connect();
          connection.login("user@bla.net", "blablabla");
      } catch (XMPPException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>This is the DummySSLSocketFactory I'm using : <a href="http://svn.igniterealtime.org/svn/repos/spark/tags/spark_2_5_3_s/src/java/org/jivesoftware/spark/util/DummySSLSocketFactory.java" rel="noreferrer">http://svn.igniterealtime.org/svn/repos/spark/tags/spark_2_5_3_s/src/java/org/jivesoftware/spark/util/DummySSLSocketFactory.java</a></p>
  
  <p>I'm thinking that the problem is that I need to select 'Legacy SSL' when connecting through PSI, I'm not sure howto do that in Java though.</p>
  
  <p>Thanks for any help</p>