Package org.jboss.security

Examples of org.jboss.security.AuthenticationManager


     * @return an instance of {@code SecurityDomainContext}
     * @throws Exception if an error occurs during creation
     */
    public SecurityDomainContext createSecurityDomainContext(String securityDomain, AuthenticationCacheFactory cacheFactory) throws Exception {
        log.debugf("Creating SDC for domain = %s", securityDomain);
        AuthenticationManager am = createAuthenticationManager(securityDomain);
        if (cacheFactory != null && am instanceof CacheableManager) {
            // create authentication cache
            final Map<Principal, ?> cache = cacheFactory.getCache();
            if (cache != null) {
                @SuppressWarnings({ "unchecked", "rawtypes" })
View Full Code Here


            subject.getPrincipals().add(auditPrincipal);
            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

   private static final Logger log = Logger.getLogger(AuthenticationInterceptorFactory.class);
  
   public Object createPerClass(Advisor advisor)
   {
      Container container = (Container)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

      }
      catch (NamingException e)
      {
         throw new RuntimeException(e);
      }
      AuthenticationManager manager = (AuthenticationManager) domain;
      RealmMapping mapping = (RealmMapping) domain;
      if (manager == null) throw new RuntimeException("Unable to find Security Domain");
      //return new RoleBasedAuthorizationInterceptor(manager, mapping, container);
      CodeSource ejbCS = advisor.getClazz().getProtectionDomain().getCodeSource();
      String ejbName = ((EJBContainer)advisor).getEjbName();
View Full Code Here

      }
     
      Interceptor interceptor = new NullInterceptor();
      if (domain != null)
      {
         AuthenticationManager manager = (AuthenticationManager) domain;
         RealmMapping mapping = (RealmMapping) domain;
         //interceptor = new RunAsSecurityInterceptor(manager, mapping, getRunAsIdentity(container));
        
         interceptor = new RunAsSecurityInterceptorv2(container, getRunAsIdentity(container));
      }
View Full Code Here

    * @return the {@code AuthenticationManager} that authenticates users according to the specified policy, or
    *         {@code null} if no {@code AuthenticationManager} is available.
    */
   public AuthenticationManager getAuthenticationManager()
   {
      AuthenticationManager manager = null;
      if (this.securityManagement != null)
         manager = this.securityManagement.getAuthenticationManager(this.name);
      return manager;
   }
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, Object cacheFactory) throws Exception {
        log.debugf("Creating SDC for domain=" + securityDomain);
        AuthenticationManager am = createAuthenticationManager(securityDomain);
        // create authentication cache
        if (cacheFactory instanceof EmbeddedCacheManager) {
            EmbeddedCacheManager cacheManager = EmbeddedCacheManager.class.cast(cacheFactory);
            @SuppressWarnings("rawtypes")
            Cache cache = null;
View Full Code Here

            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

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.