Package javax.security.auth.login

Examples of javax.security.auth.login.LoginContext.logout()


        // try to log out of the context.
        try {
          LoginContext context = info.getLoginContext();
          if (context != null) {
            context.logout();
          }
    } catch (LoginException e) {
       LogManager.logWarning(LogConstants.CTX_SECURITY,e,"Exception terminitating session"); //$NON-NLS-1$
    }
  }
View Full Code Here


      log.info("Obtained server version: "+version);
      MBeanInfo info = conn.getMBeanInfo(server);
      assertNotNull("MBeanInfo != null", info);
      Integer mbeanCount = conn.getMBeanCount();
      assertNotNull("mbeanCount != null", mbeanCount);
      lc.logout();
   }
  
   /**
    * Test invalid access
    * @throws Exception
View Full Code Here

      {
         Object entry = list.next();
         getLog().debug(" + "+entry);
      }
      ctx.close();
      lc.logout();

      Principal p = SecurityAssociation.getPrincipal();
      assertTrue("SecurityAssociation.getPrincipal is null", p == null);

      /* This is now failing because we don't appear to have anyway to flush
View Full Code Here

   protected void stopService() throws Exception
   {
      if( systemSubject != null )
      {
         LoginContext lc = new LoginContext(securityDomain, systemSubject, callbackHandler);
         lc.logout();
      }
   }
}
View Full Code Here

      assertTrue("Principals contains Roles", groups.contains(new SimplePrincipal("Roles")));
      Group roles = (Group) groups.iterator().next();
      assertTrue("Echo is a role", roles.isMember(new SimplePrincipal("Echo")));
      assertTrue("TheDuke is a role", roles.isMember(new SimplePrincipal("TheDuke")));

      lc.logout();
   }
   public void testLdapExample11() throws Exception
   {
      System.out.println("testLdapExample11");
      UsernamePasswordHandler handler = new UsernamePasswordHandler("jduke", "theduke".toCharArray());
View Full Code Here

      assertTrue("Principals contains Roles", groups.contains(new SimplePrincipal("Roles")));
      Group roles = (Group) groups.iterator().next();
      assertTrue("Echo is a role", roles.isMember(new SimplePrincipal("Echo")));
      assertTrue("TheDuke is a role", roles.isMember(new SimplePrincipal("TheDuke")));

      lc.logout();
   }
   public void testLdapExample11Encrypt() throws Exception
   {
      System.out.println("testLdapExample11Encrypt");
      MBeanServer server = MBeanServerFactory.createMBeanServer("jboss");
View Full Code Here

      assertTrue("Principals contains Roles", groups.contains(new SimplePrincipal("Roles")));
      Group roles = (Group) groups.iterator().next();
      assertTrue("Echo is a role", roles.isMember(new SimplePrincipal("Echo")));
      assertTrue("TheDuke is a role", roles.isMember(new SimplePrincipal("TheDuke")));

      lc.logout();
      MBeanServerFactory.releaseMBeanServer(server);
   }
   /*
version: 1
dn: o=example2,dc=jboss,dc=org
View Full Code Here

      assertTrue("Echo is a role", roles.isMember(new SimplePrincipal("Echo")));
      assertTrue("TheDuke is a role", roles.isMember(new SimplePrincipal("TheDuke")));
      assertFalse("Echo2 is NOT a role", roles.isMember(new SimplePrincipal("Echo2")));
      assertFalse("TheDuke2 is NOT a role", roles.isMember(new SimplePrincipal("TheDuke2")));

      lc.logout();
   }
   public void testLdapExample21() throws Exception
   {
      System.out.println("testLdapExample21");
      UsernamePasswordHandler handler = new UsernamePasswordHandler("jduke",
View Full Code Here

      assertTrue("Principals contains Roles", groups.contains(new SimplePrincipal("Roles")));
      Group roles = (Group) groups.iterator().next();
      assertTrue("Echo is a role", roles.isMember(new SimplePrincipal("Echo")));
      assertTrue("TheDuke is a role", roles.isMember(new SimplePrincipal("TheDuke")));

      lc.logout();
   }
   public void testLdapExample21Encrypt() throws Exception
   {
      System.out.println("testLdapExample21Encrypt");
      MBeanServer server = MBeanServerFactory.createMBeanServer("jboss");
View Full Code Here

      assertTrue("Principals contains Roles", groups.contains(new SimplePrincipal("Roles")));
      Group roles = (Group) groups.iterator().next();
      assertTrue("Echo is a role", roles.isMember(new SimplePrincipal("Echo")));
      assertTrue("TheDuke is a role", roles.isMember(new SimplePrincipal("TheDuke")));

      lc.logout();
      MBeanServerFactory.releaseMBeanServer(server);
   }
   public void testLdapExample23() throws Exception
   {
      System.out.println("testLdapExample23");
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.