Examples of JaasSecurityManager


Examples of org.jboss.security.plugins.JaasSecurityManager

    */
   public void testStringCharArrayCredential()
   {
      SimplePrincipal jduke = new SimplePrincipal("jduke");
      CallbackHandler handler = new SecurityAssociationHandler(jduke, "theduke".toCharArray());
      JaasSecurityManager sm = new JaasSecurityManager("testStringCharArrayCredential", handler);
      TimedCachePolicy cache = new TimedCachePolicy(600, true, 10);
      cache.create();
      cache.start();
      sm.setCachePolicy(cache);

      // Initial validation to populate the cache
      assertTrue(sm.isValid(jduke, "theduke"));
      // Validate that the String credential form uses the cache
      assertTrue(sm.isValid(jduke, "theduke"));
      // Validate that the char[] credential form uses the cache
      assertTrue(sm.isValid(jduke, "theduke".toCharArray()));
   }
View Full Code Here

Examples of org.jboss.security.plugins.JaasSecurityManager

    */
   public void testCharArrayStringCredential()
   {
      SimplePrincipal jduke = new SimplePrincipal("jduke");
      CallbackHandler handler = new SecurityAssociationHandler(jduke, "theduke".toCharArray());
      JaasSecurityManager sm = new JaasSecurityManager("testStringCharArrayCredential", handler);
      TimedCachePolicy cache = new TimedCachePolicy(600, true, 10);
      cache.create();
      cache.start();
      sm.setCachePolicy(cache);

      // Reset the validation count
      CountedLoginModule.validateCount = 0;
      // Initial validation to populate the cache
      assertTrue(sm.isValid(jduke, "theduke".toCharArray()));
      // Validate that the char[] credential form uses the cache
      assertTrue(sm.isValid(jduke, "theduke".toCharArray()));
      // Validate that the String credential form uses the cache
      assertTrue(sm.isValid(jduke, "theduke"));
   }
View Full Code Here

Examples of org.jboss.security.plugins.JaasSecurityManager

      ctx.rebind(SECURITY_MGR_PATH, ref);
   }

   private static JaasSecurityManager getSecurityManager(String name)
   {
      JaasSecurityManager manager = cache.get(name);
      if (manager != null)
      {
         //log.info("cache hit");
         return manager;
      }
      synchronized (cache)
      {
         if (manager != null)
            return manager;

         manager = new JaasSecurityManager(name, new SecurityAssociationHandler());
         cache.put(name, manager);
      }
      return manager;
   }
View Full Code Here

Examples of org.jboss.security.plugins.JaasSecurityManager

/*  82 */     ctx.rebind("java:/jaas", ref);
/*     */   }
/*     */
/*     */   private static JaasSecurityManager getSecurityManager(String name)
/*     */   {
/*  87 */     JaasSecurityManager manager = (JaasSecurityManager)cache.get(name);
/*  88 */     if (manager != null)
/*     */     {
/*  91 */       return manager;
/*     */     }
/*  93 */     synchronized (cache)
/*     */     {
/*  95 */       if (manager != null) {
/*  96 */         return manager;
/*     */       }
/*  98 */       manager = new JaasSecurityManager(name, new SecurityAssociationHandler());
/*  99 */       cache.put(name, manager);
/*     */     }
/* 101 */     return manager;
/*     */   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.