Package org.jboss.web.tomcat.security.login

Examples of org.jboss.web.tomcat.security.login.WebAuthentication


         Credentials credentials  = (Credentials)httpRequest.getSession().getAttribute(PortalLoginModule.AUTHENTICATED_CREDENTIALS);

         // Make programatic login if authenticated credentials are present in session - they were set in another cluster node
         if (credentials != null && httpRequest.getRemoteUser() == null)
         {
            WebAuthentication pwl = new WebAuthentication();
            pwl.login(credentials.getUsername(), credentials.getPassword());

         }

         chain.doFilter(request, response);
View Full Code Here


   private void login(HttpServletRequest request, String username, String pass)
   throws ServletException
   {
      if(username == null || pass == null)
         throw new RuntimeException("username or password is null");
      WebAuthentication pwl = new WebAuthentication();
      pwl.login(username, pass);

      //Only when there is web login, does the principal become visible
      log("User Principal=" + request.getUserPrincipal());
      log("isUserInRole(Authorized User)=" + request.isUserInRole("AuthorizedUser"));
      if(request.getUserPrincipal() == null || !request.isUserInRole("AuthorizedUser"))
View Full Code Here

   }
  
   private void logout(HttpServletRequest request) throws ServletException
   {
      //Log the user out
      new WebAuthentication().logout();
      if(request.getUserPrincipal() != null || request.isUserInRole("AuthorizedUser"))
         throw new ServletException("User is still authenticated or pass: isUserInRole(Authorized User)");
   }
View Full Code Here

            SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
            SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter();

            if (securityAdaptor != null && securityAdaptor.getPrincipal() != null && securityAdaptor.getPrincipal().getName() != null && securityAdaptor.getCredential() != null)
            {
               WebAuthentication wa = new WebAuthentication();
               wa.login(securityAdaptor.getPrincipal().getName(), securityAdaptor.getCredential());
            }
            else
            {
               log.debug("No securityAdaptor available. Cannot add credentials from the WS Security");
            }
View Full Code Here

   private void login(HttpServletRequest request, String username, String pass)
   throws ServletException
   {
      if(username == null || pass == null)
         throw new RuntimeException("username or password is null");
      WebAuthentication pwl = new WebAuthentication();
      pwl.login(username, pass);

      //Only when there is web login, does the principal become visible
      log("User Principal=" + request.getUserPrincipal());
      log("isUserInRole(Authorized User)=" + request.isUserInRole("AuthorizedUser"));
      if(request.getUserPrincipal() == null || !request.isUserInRole("AuthorizedUser"))
View Full Code Here

   }
  
   private void logout(HttpServletRequest request) throws ServletException
   {
      //Log the user out
      new WebAuthentication().logout();
      if(request.getUserPrincipal() != null || request.isUserInRole("AuthorizedUser"))
         throw new ServletException("User is still authenticated or pass: isUserInRole(Authorized User)");
   }
View Full Code Here

                    PortalLoginModule.AUTHENTICATED_CREDENTIALS);

            // Make programatic login if authenticated credentials are present in session - they were set in another cluster
            // node
            if (credentials != null && httpRequest.getRemoteUser() == null) {
                WebAuthentication pwl = new WebAuthentication();
                pwl.login(credentials.getUsername(), credentials.getPassword());

            }

            chain.doFilter(request, response);
View Full Code Here

        if (session != null && session.getAttribute(CONST_CAS_ASSERTION) == null && ticket != null) {
            try {
                final String service = constructServiceUrl(request, response);
                logger.debug("Attempting CAS ticket validation with service={} and ticket={}", service, ticket);
                if (!new WebAuthentication().login(service, ticket)) {
                    logger.debug("JBoss Web authentication failed.");
                    throw new GeneralSecurityException("JBoss Web authentication failed.");
                }
                if (request.getUserPrincipal() instanceof AssertionPrincipal) {
                    final AssertionPrincipal principal = (AssertionPrincipal) request.getUserPrincipal();
View Full Code Here

                    PortalLoginModule.AUTHENTICATED_CREDENTIALS);

            // Make programatic login if authenticated credentials are present in session - they were set in another cluster
            // node
            if (credentials != null && httpRequest.getRemoteUser() == null) {
                WebAuthentication pwl = new WebAuthentication();
                pwl.login(credentials.getUsername(), credentials.getPassword());

            }

            chain.doFilter(request, response);
View Full Code Here

         Credentials credentials  = (Credentials)httpRequest.getSession().getAttribute(PortalLoginModule.AUTHENTICATED_CREDENTIALS);
        
         // Make programatic login if authenticated credentials are present in session - they were set in another cluster node
         if (credentials != null && httpRequest.getRemoteUser() == null)
         {
            WebAuthentication pwl = new WebAuthentication();
            pwl.login(credentials.getUsername(), credentials.getPassword());

         }

         chain.doFilter(request, response);
View Full Code Here

TOP

Related Classes of org.jboss.web.tomcat.security.login.WebAuthentication

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.