Package org.jboss.security.plugins

Examples of org.jboss.security.plugins.JBossAuthenticationManager


      InitialContext ctx = new InitialContext();
      ctx.bind("java:policyRegistration", new SimplePolicyRegistration());

      JBossSecurityContext context = new JBossSecurityContext("TestApp");
      JBossAuthenticationManager authenticationManager = (JBossAuthenticationManager) context.getAuthenticationManager();
      TimedCachePolicy domainCache = new TimedCachePolicy();
      domainCache.create();
      domainCache.start();
      authenticationManager.setCachePolicy(domainCache);
      NonSerializableFactory.rebind(ctx, "java:AuthenticationManager", authenticationManager);
   }
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

TOP

Related Classes of org.jboss.security.plugins.JBossAuthenticationManager

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.