0 Replies Latest reply on May 10, 2015 1:39 AM by leru

    Login Form based with security-domain other error

    leru

      2015-05-10 07:28:03,738 TRACE [org.jboss.security] (default task-13) PBOX000236: Begin initialize method

      2015-05-10 07:28:03,738 TRACE [org.jboss.security] (default task-13) PBOX000240: Begin login method

      2015-05-10 07:28:03,738 TRACE [org.jboss.security] (default task-13) PBOX000236: Begin initialize method

      2015-05-10 07:28:03,738 TRACE [org.jboss.security] (default task-13) PBOX000240: Begin login method

      2015-05-10 07:28:03,738 TRACE [org.jboss.security] (default task-13) PBOX000241: End login method, isValid: true

      2015-05-10 07:28:03,738 TRACE [org.jboss.security] (default task-13) PBOX000242: Begin commit method, overall result: false

      2015-05-10 07:28:03,738 TRACE [org.jboss.security] (default task-13) PBOX000242: Begin commit method, overall result: true

      2015-05-10 07:28:03,753 TRACE [org.jboss.security] (default task-13) PBOX000210: defaultLogin, login context: javax.security.auth.login.LoginContext@794d6663, subject: Subject(532492985).principals=org.jboss.security.SimplePrincipal@1045241846(mass)org.jboss.security.SimpleGroup@963473262(Roles(members:essigUsers))org.jboss.security.SimpleGroup@963473262(CallerPrincipal(members:mass))

      2015-05-10 07:28:03,753 TRACE [org.jboss.security] (default task-13) PBOX000207: updateCache, input subject: Subject(532492985).principals=org.jboss.security.SimplePrincipal@1045241846(mass)org.jboss.security.SimpleGroup@963473262(Roles(members:essigUsers))org.jboss.security.SimpleGroup@963473262(CallerPrincipal(members:mass)), cached subject: Subject(786390232).principals=org.jboss.security.SimplePrincipal@1045241846(mass)org.jboss.security.SimpleGroup@963473262(Roles(members:essigUsers))org.jboss.security.SimpleGroup@963473262(CallerPrincipal(members:mass))

      2015-05-10 07:28:03,753 TRACE [org.jboss.security] (default task-13) PBOX000208: Inserted cache info: org.jboss.security.authentication.JBossCachedAuthenticationManager$DomainInfo@4a4880f2

      2015-05-10 07:28:03,753 TRACE [org.jboss.security] (default task-13) PBOX000201: End isValid, result = true

      2015-05-10 07:28:03,769 TRACE [org.jboss.security] (default task-13) PBOX000354: Setting security roles ThreadLocal: null

       

       

      <!--       Here is my Authentication class-->

       

      @Stateless

       

      @RolesAllowed({ "essigUsers" })

      @SecurityDomain("other")

      @ManagedBean(name = "H_Autenticazione")

      public class H_Autenticazione implements Serializable {

       

         

           // Inject the Session Context

             @Resource

             private SessionContext ctx;

       

             private BO_User user;

         

          private static final long serialVersionUID = -4568955583584700480L;

       

          private static final Log logger = LogFactory.getLog(H_Autenticazione.class);

       

          @PostConstruct

          public void init() {

              logger.debug(Constants.START);

       

              logger.debug(Constants.END);

          }

         

         

         

          /**

          public String logout() {

              GuiUtil.removeManagedBean(Constants.SESSION_USER);

       

              S2mcUtility.invalidateSession();

       

              return "logout";

          }

      */

          

         

         

         

         

          public String redirectFunction() {

             

             

             

               /**

             

                 

                   Principal principal = ctx.getCallerPrincipal();

                   logger.debug("SUBJECT:" + principal);

                 

                  FacesContext facesContext = FacesContext.getCurrentInstance();

             

                  HttpSession httpSession = (HttpSession) facesContext.getExternalContext().getSession(false);

              */

                  try {

                      String subj=ctx.getCallerPrincipal().toString();

                      FacesContext facesContext = FacesContext.getCurrentInstance();

       

                      HttpSession httpSession = (HttpSession) facesContext.getExternalContext().getSession(false);

       

                     

                  BO_User user = (BO_User) httpSession.getAttribute(Constants.SESSION_USER);

       

                  if ((user == null) || (user.getIdSession() == null)) {

                      user = (BO_User) S2mcUtility.getBean(Constants.SESSION_USER);

                      user.setIdSession(httpSession.getId());

                      httpSession.setAttribute(Constants.SESSION_USER, user);

                  }

                 

                  ISRVPresentation srvPresentation = (ISRVPresentation) S2mcUtility.getService(Constants.SERVIZIO_PRESENTATION);

       

                  List<BO_Page> listaPagine = srvPresentation.getPresentationCodMansFiguraUnita("Essai","Essai");

       

                  user.setListaPagine(listaPagine);

                  user.setLocaleCode(Locale.getDefault().getCountry().toLowerCase());

       

                  new H_HomePage().initHomePage();

       

                  S2mcUtility.logMethod(logger, false);

              } catch (Exception e) {

                  e.printStackTrace();

              }

       

              return "/pages/home?faces-redirect=true";

          }

         

      }

      <!-------------->Login form<-------->

      <form method="post" id="logonForm"

                      action="${facesContext.externalContext.requestContextPath}/j_security_check">

                      <div class="input-group mb15">

       

                          <!--[if IE 8]>

                                  CHIAVE UTENTE<br>

                                  <![endif]-->

       

                          <!--[if !IE]>

                                  <!-->

                          <span class="input-group-addon"><i

                              class="glyphicon glyphicon-user"></i> </span>

                          <!--<![endif]-->

       

                          <input type="text" id="j_username" name="j_username"

                              class="form-control" placeholder="KEY USER"

                              style="text-transform: uppercase; width: 280px;" />

                      </div>

       

                      <div class="input-group mb15">

                          <!--[if IE 8]>

                              PASSWORD<br>

                          <![endif]-->

       

                          <!--[if !IE]>

                          <!-->

                              <span class="input-group-addon"><i

                              class="glyphicon glyphicon-lock"></i> </span>

                          <!--<![endif]-->

       

                          <input type="password" id="j_password" name="j_password"

                              class="form-control" placeholder="PASSWORD" style="width: 280px;" />

                      </div>

       

                      <div class="clearfix">

                          <div>

                              <!--[if IE 8]>

                                  <input type="submit" id="accedi" value="ACCEDI" style="width:280px"/>

                              <![endif]-->

       

                              <!--[if !IE]>

                              <!-->

                                  <input type="submit" id="accedi" value="ACCEDI" style="width: 100%" />

                              <!--<![endif]-->

                          </div>

                      </div>

                  </form>