1 Reply Latest reply on Feb 26, 2017 1:45 AM by Anup Dey

    eap6  securitycontext is null in new thread after login

    johnny shaw Newbie

      public void onMessage(Message message) {

       

         

      LoginContext lc =

      new LoginContext(LOGIN_CONFIG,

        new SimpleCallbackHandler(username, password));

      lc.login();

       

      Runnable run = new Runnable() {

       

        @Override

        public void run() {

      // out is null

        System.out.println(SecurityContextAssociation.getSecurityContext());

       

        }

        };

        Thread thread1 = new Thread(run);

        thread1.start();

      }

      LOGIN_CONFIG is login-internal that configured in standalone-full.xml

      <security-domain name="login-internal" cache-type="default">

                          <authentication>

                              <login-module code="org.jboss.security.ClientLoginModule" flag="required">

                                  <module-option name="multi-threaded" value="true"/>

                                  <module-option name="restore-login-identity" value="true"/>

                              </login-module>

                          </authentication>

                      </security-domain>