Package org.jboss.security.auth.callback

Examples of org.jboss.security.auth.callback.SecurityAssociationHandler


    name of that given by the 'securityDomain' argument.
    @param securityDomain , the name of the security domain
    */
   public JaasSecurityDomain(String securityDomain)
   {
      this(securityDomain, new SecurityAssociationHandler());
   }
View Full Code Here


   /** Creates a default JaasSecurityManager for with a securityDomain
    name of 'other'.
    */
   public JaasSecurityManagerBase()
   {
      this("other", new SecurityAssociationHandler());
   }
View Full Code Here

   /** Creates a default JaasSecurityManager for default securityDomain.
    */
   public JaasSecurityManager()
   {
      this(SecurityConstants.DEFAULT_APPLICATION_POLICY, new SecurityAssociationHandler());
   }
View Full Code Here

      int iterations = Integer.getInteger("jbosstest.iterationcount", 5000).intValue();
      log.info("Creating "+count+" threads doing "+iterations+" iterations");
      PolicyContext.registerHandler(SecurityConstants.SUBJECT_CONTEXT_KEY,
          new SubjectPolicyContextHandler(), false);
      AuthorizationManager am = new JBossAuthorizationManager("testIdentity");
      JaasSecurityManager secMgr = new JaasSecurityManager("testIdentity", new SecurityAssociationHandler());
      TimedCachePolicy cache = new TimedCachePolicy(3, false, 100);
      cache.create();
      cache.start();
      secMgr.setCachePolicy(cache);
      Thread[] testThreads = new Thread[count];
View Full Code Here

      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      URL resURL = loader.getResource("security/tst.keystore");
      store.load(resURL.openStream(), "unit-tests".toCharArray());
      X509Certificate cert = (X509Certificate) store.getCertificate("unit-tests");
      SimplePrincipal x509 = new SimplePrincipal("unit-tests");
      SecurityAssociationHandler handler = new SecurityAssociationHandler(x509, cert);
      LoginContext lc = new LoginContext("testCertLogin", handler);
      lc.login();
      Subject subject = lc.getSubject();
      assertTrue("Principals contains unit-tests", subject.getPrincipals().contains(new SimplePrincipal("unit-tests")));
      assertTrue("Principals contains x509cert",
View Full Code Here

      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      URL resURL = loader.getResource("security/tst.keystore");
      store.load(resURL.openStream(), "unit-tests".toCharArray());
      X509Certificate cert = (X509Certificate) store.getCertificate("unit-tests");
      SimplePrincipal x509 = new SimplePrincipal("unit-tests");
      SecurityAssociationHandler handler = new SecurityAssociationHandler(x509, cert);
      LoginContext lc = new LoginContext("testCertRoles", handler);
      lc.login();
      Subject subject = lc.getSubject();
      Set groups = subject.getPrincipals(Group.class);
      assertTrue("Principals contains unit-tests", subject.getPrincipals().contains(new SimplePrincipal("unit-tests")));
View Full Code Here

    * credential do not cause thrashing of the domain cache.
    */
   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);
View Full Code Here

    * credential do not cause thrashing of the domain cache.
    */
   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);
View Full Code Here

                                            contextId,null);
         if(acp == null)
         {
            acp = new JBossAuthConfigProvider(null);
        
         CallbackHandler cbh = new SecurityAssociationHandler();
         ServerAuthConfig sc = acp.getServerAuthConfig(SecurityConstants.SERVLET_LAYER,
                                            contextId,cbh);
         if(sc == null)
            throw new ServletException("ServerAuthConfig is null");
         ServerAuthContext sa = sc.getAuthContext(null,null, null);
View Full Code Here

   /** Creates a default JaasSecurityManager for with a securityDomain
    name of 'other'.
    */
   public JaasSecurityManagerBase()
   {
      this("other", new SecurityAssociationHandler());
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.auth.callback.SecurityAssociationHandler

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.