Package org.jboss.security

Examples of org.jboss.security.AuthenticationManager


            subject.getPrincipals().add(unauthenticatedIdentity.asPrincipal());
            authenticated = true;
        }

        if (authenticated == false) {
            AuthenticationManager authenticationManager = context.getAuthenticationManager();
            authenticated = authenticationManager.isValid(principal, credential, subject);
        }
        if (authenticated == true) {
            subjectInfo.setAuthenticatedSubject(subject);
        }
View Full Code Here


        ClassLoader tcl = SecurityActions.getContextClassLoader();
        // Set the Module Class loader as the tccl such that the JNDI lookup of the JBoss Authentication/Authz managers succeed
        SecurityActions.setContextClassLoader(classLoader);

        try {
            AuthenticationManager authM = getAuthenticationManager(securityDomain);
            realm.setAuthenticationManager(authM);

            AuthorizationManager authzM = getAuthorizationManager(securityDomain);
            realm.setAuthorizationManager(authzM);
View Full Code Here

            String domainCtx = SecurityConstants.JAAS_CONTEXT_ROOT + "/" + unprefixed + "/domainContext";
            SecurityDomainContext sdc = (SecurityDomainContext) iniCtx.lookup(domainCtx);
            Object securityMgr = sdc.getSecurityManager();

            // Object securityMgr = iniCtx.lookup(confSecurityDomain);
            AuthenticationManager ejbS = (AuthenticationManager) securityMgr;
            RealmMapping rM = (RealmMapping) securityMgr;
            container.setSecurityManager(ejbS);
            container.setRealmMapping(rM);

            container.setSecurityManagement(securityManagement);
View Full Code Here

         of the ejb spec requirement that runtime exceptions should invalidate
         the session.
          */
         if(!callerRunAsIdentityPresent && pushSecurityContext)
         {
            AuthenticationManager am = container.getSecurityManager();
            String securityDomain = SecurityConstants.DEFAULT_APPLICATION_POLICY;
            if(am != null)
               securityDomain = am.getSecurityDomain();
            SecurityActions.createAndSetSecurityContext(mi.getPrincipal(), mi.getCredential(),
                  securityDomain , null);
            //SecurityActions.pushSubjectContext(mi.getPrincipal(), mi.getCredential(), null);
         }

View Full Code Here

   private static final Logger log = Logger.getLogger(AuthenticationInterceptorFactory.class);
  
   public Object createPerClass(Advisor advisor)
   {
      Container container = EJBContainer.getEJBContainer(advisor);
      AuthenticationManager manager = container.getSecurityManager(AuthenticationManager.class);
      log.debug("Creating interceptor with authentication manager '" + manager + "'" + (manager != null ? " (security domain '" + manager.getSecurityDomain() + "')" : ""));
      //return new Ejb3AuthenticationInterceptor(manager, container);
     
      return new Ejb3AuthenticationInterceptorv2(container);
   }
View Full Code Here

      // get the test bean and validate all mock managers have been injected.
      TestBean testBean = (TestBean) super.getBean("TestBean");
      assertNotNull("TestBean could not be found", testBean);

      // check the authentication manager injection.
      AuthenticationManager authenticationManager = testBean.getAuthenticationManager();
      assertNotNull("Invalid null AuthenticationManager found", authenticationManager);
      assertEquals("Invalid AuthenticationManager implementation found", MockAuthenticationManager.class,
            authenticationManager.getClass());
      assertEquals("TestPolicy1", authenticationManager.getSecurityDomain());

      // check the authorization manager injection.
      AuthorizationManager authorizationManager = testBean.getAuthorizationManager();
      assertNotNull("Invalid null AuthorizationManager found", authorizationManager);
      assertEquals("Invalid AuthorizationManager implementation found", MockAuthorizationManager.class,
View Full Code Here

        return am;
    }

    /** {@inheritDoc} */
    public AuthenticationManager getAuthenticationManager(String securityDomain) {
        AuthenticationManager am = null;
        try {
            am = authMgrMap.get(securityDomain);
            if (am == null) {
                am = (AuthenticationManager) lookUpJNDI(securityDomain + "/authenticationMgr");
                authMgrMap.put(securityDomain, am);
View Full Code Here

     * @return an instance of {@code SecurityDomainContext}
     * @throws Exception if an error occurs during creation
     */
    public SecurityDomainContext createSecurityDomainContext(String securityDomain) throws Exception {
        log.debug("Creating SDC for domain=" + securityDomain);
        AuthenticationManager am = createAuthenticationManager(securityDomain);
        // TODO create auth cache and set it in am

        // set DeepCopySubject option if supported
        if (deepCopySubjectMode) {
            setDeepCopySubjectMode(am);
View Full Code Here

   public void setContainer(Container container)
   {
      super.setContainer(container);
      if (container != null)
      {
         AuthenticationManager am = container.getSecurityManager();
         if(am != null)
         {
            securityDomain = am.getSecurityDomain();
         }
      }
      try
      {
         timedObjectMethod = TimedObject.class.getMethod("ejbTimeout", new Class[]{Timer.class})
View Full Code Here

      throw new RuntimeException("PER_VM not supported for this interceptor factory, only PER_CLASS");
   }

   public Object createPerClass(Advisor advisor)
   {
      AuthenticationManager manager = (AuthenticationManager) advisor.getDefaultMetaData().getMetaData("security", "authentication-manager");
      if (manager == null)
      {
         SecurityDomain domain = (SecurityDomain) advisor.resolveAnnotation(SecurityDomain.class);
         if (domain == null) throw new RuntimeException("Unable to determine security domain");
         try
View Full Code Here

TOP

Related Classes of org.jboss.security.AuthenticationManager

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.