[jboss-cvs] JBossAS SVN: r91525 - in projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src: test/java/org/jboss/test/authentication/jaas and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 21 18:46:25 EDT 2009
Author: anil.saldhana at jboss.com
Date: 2009-07-21 18:46:25 -0400 (Tue, 21 Jul 2009)
New Revision: 91525
Modified:
projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/security/ClientLoginModule.java
projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/test/java/org/jboss/test/authentication/jaas/ClientLoginModuleUnitTestCase.java
Log:
SECURITY-415: when explicitly multi-threaded flag is set to false, then assume client mode. Note the absence of the flag does not indicate it is false
Modified: projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/security/ClientLoginModule.java
===================================================================
--- projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/security/ClientLoginModule.java 2009-07-21 21:59:08 UTC (rev 91524)
+++ projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/security/ClientLoginModule.java 2009-07-21 22:46:25 UTC (rev 91525)
@@ -118,9 +118,13 @@
log.trace("Enabling multi-threaded mode");
SecurityAssociationActions.setServer();
}
- else
+
+ /**
+ * SECURITY-415: when the multi-threaded value is explictly set
+ * at false, then get into the client mode.
+ */
+ if(flag != null && flag.length() > 0 && "false".equalsIgnoreCase(flag))
{
- //Turn on the client side vm wide association
SecurityAssociationActions.setClient();
}
Modified: projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/test/java/org/jboss/test/authentication/jaas/ClientLoginModuleUnitTestCase.java
===================================================================
--- projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/test/java/org/jboss/test/authentication/jaas/ClientLoginModuleUnitTestCase.java 2009-07-21 21:59:08 UTC (rev 91524)
+++ projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/test/java/org/jboss/test/authentication/jaas/ClientLoginModuleUnitTestCase.java 2009-07-21 22:46:25 UTC (rev 91525)
@@ -36,6 +36,7 @@
import junit.framework.TestSuite;
import org.jboss.security.SecurityAssociation;
+import org.jboss.security.SecurityContext;
import org.jboss.security.SecurityContextAssociation;
import org.jboss.security.SimplePrincipal;
import org.jboss.security.auth.callback.UsernamePasswordHandler;
@@ -184,6 +185,10 @@
Arrays.equals(password, "theduke".toCharArray()));
assertTrue("Client side association?", SecurityContextAssociation.isClient());
+
+ SecurityContext sc = SecurityContextAssociation.getSecurityContext();
+ assertNotNull("SecurityContext not null", sc);
+ assertEquals("jduke", sc.getUtil().getUserPrincipal().getName());
}
public void testSingleThreadedRestoreIdentity() throws Exception
More information about the jboss-cvs-commits
mailing list