title: How to add a JAAS login module to Artemis?
body: <p>I'd like to add a custom JAAS login module to ActiveMQ Artemis. Therefore, I created a class (i.e. <code>MyLogin</code>) that implements <code>javax.security.auth.spi.LoginModule</code>.</p>
  
  <pre class="lang-java prettyprint-override"><code>public class MyLogin implements javax.security.auth.spi.LoginModule
  {
  
      @Override
      public boolean abort() throws LoginException
      {
          out( "abort" );
          return true;
      }
  
      @Override
      public boolean commit() throws LoginException
      {
          out( "commit" );
          return true;
      }
  
      @Override
      public void initialize( Subject subject, CallbackHandler callbackHandler, Map&lt;String, ?&gt; sharedState, Map&lt;String, ?&gt; options )
      {
          out( "initialize" );
      }
  
      @Override
      public boolean login() throws LoginException
      {
          out( "login" );
          return true;
      }
  
      @Override
      public boolean logout() throws LoginException
      {
          out( "logout" );
          return true;
      }
  
      private void out( String msg )
      {
          System.out.println( "MSO: " + msg );
          System.err.println( "MSW: " + msg );
  
      }
  
  }
  </code></pre>
  
  <p>I put this class in a jar and put it into the <code>%artemis_home%/lib</code> directory.</p>
  
  <p>In <code>login.config</code> I changed the entry for <code>activemq</code> to</p>
  
  <pre><code>activemq {
      t1.security.MyLogin sufficient
      debug=true
  };
  </code></pre>
  
  <p>What I'd expect is that each connection will succeed, but it simply does not work. Now all connections are refused, and I don't see any of the messages printed out in <code>MyLogin</code> class.</p>
  
  <p>Is there any way to find out if this <code>LoginModule</code> is loaded, or how can I debug this? </p>