Package org.jboss.security

Examples of org.jboss.security.AuthenticationManager


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


/*     */     }
/*     */
/*  99 */     Interceptor interceptor = new NullInterceptor();
/* 100 */     if (domain != null)
/*     */     {
/* 102 */       AuthenticationManager manager = (AuthenticationManager)domain;
/* 103 */       RealmMapping mapping = (RealmMapping)domain;
/*     */
/* 106 */       interceptor = new RunAsSecurityInterceptorv2(container, getRunAsIdentity(container));
/*     */     }
/* 108 */     return interceptor;
View Full Code Here

/*     */   public void setContainer(Container container)
/*     */   {
/*  59 */     super.setContainer(container);
/*  60 */     if (container != null)
/*     */     {
/*  62 */       AuthenticationManager am = container.getSecurityManager();
/*  63 */       if (am != null)
/*     */       {
/*  65 */         this.securityDomain = am.getSecurityDomain();
/*     */       }
/*     */     }
/*     */     try
/*     */     {
/*  70 */       this.timedObjectMethod = TimedObject.class.getMethod("ejbTimeout", new Class[] { Timer.class }).getName();
View Full Code Here

   public void testManagersFromJBossSecurityContext() throws Exception
   {
      JBossSecurityContext sc = this.getSC("other");
      ISecurityManagement ism = sc.getSecurityManagement();
      assertNotNull("Security Management is not null", ism);
      AuthenticationManager authManager = sc.getAuthenticationManager();
      assertNotNull("AuthenticationManager is not null", authManager);
      AuthorizationManager authorizationMgr = sc.getAuthorizationManager();
      assertNotNull("AuthorizationManager is not null", authorizationMgr);
      AuditManager auditManager = sc.getAuditManager();
      assertNotNull("AuditManager is not null", auditManager);
View Full Code Here

      establishSecurityConfiguration();
   }

   public void testSecurityDomain() throws Exception
   {
      AuthenticationManager am = new JBossAuthenticationManager("test1",
            new AppCallbackHandler("a","b".toCharArray()));
      assertEquals("test1", am.getSecurityDomain());
   }
View Full Code Here

  
   public void testLogin() throws Exception
   {
      Principal p = new SimplePrincipal("jduke");
      AppCallbackHandler acbh = new AppCallbackHandler("jduke","theduke".toCharArray());
      AuthenticationManager am = new JBossAuthenticationManager("test",acbh);
      assertTrue(am.isValid(p, "theduke"));
  
View Full Code Here

  
   public void testUnsuccessfulLogin() throws Exception
   {
      Principal p = new SimplePrincipal("jduke");
      AppCallbackHandler acbh = new AppCallbackHandler("jduke","bad".toCharArray());
      AuthenticationManager am = new JBossAuthenticationManager("test",acbh);
      assertFalse(am.isValid(p, "bad"));
   }
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

            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

        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

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.