Author: anil.saldhana(a)jboss.com
Date: 2011-06-08 00:17:28 -0400 (Wed, 08 Jun 2011)
New Revision: 984
Modified:
federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java
federation/trunk/picketlink-bindings-jboss/src/test/java/org/picketlink/test/identity/federation/bindings/jboss/auth/SAML2STSLoginModuleUnitTestCase.java
Log:
use local testing option
Modified:
federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java
===================================================================
---
federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java 2011-06-08
01:28:14 UTC (rev 983)
+++
federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java 2011-06-08
04:17:28 UTC (rev 984)
@@ -134,7 +134,7 @@
protected String securityDomain = null;
- protected String groupName = "Roles";
+ protected String groupName = SecurityConstants.ROLES_IDENTIFIER;
protected boolean localValidation = false;
@@ -182,6 +182,9 @@
*/
public static final String PASSWORD_KEY = "password";
+ //A variable used by the unit test to pass local validation
+ private boolean localTestingOnly = false;
+
/*
* (non-Javadoc)
* @see
org.jboss.security.auth.spi.AbstractServerLoginModule#initialize(javax.security.auth.Subject,
javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map)
@@ -225,6 +228,12 @@
if
(localValidationSecurityDomain.startsWith(SecurityConstants.JAAS_CONTEXT_ROOT) == false)
localValidationSecurityDomain = SecurityConstants.JAAS_CONTEXT_ROOT +
"/" + localValidationSecurityDomain;
+
+ String localTestingOnlyStr = (String)
options.get("localTestingOnly");
+ if (StringUtil.isNotNull(localTestingOnlyStr))
+ {
+ localTestingOnly = Boolean.valueOf(localTestingOnlyStr);
+ }
}
}
@@ -490,10 +499,10 @@
protected boolean localValidation(Element assertionElement) throws Exception
{
- if (StringUtil.isNotNull(SecurityActions.getSystemProperty("PL_TEST")))
//Local testing
- {
+ //For unit tests
+ if (localTestingOnly)
return true;
- }
+
try
{
Context ctx = new InitialContext();
Modified:
federation/trunk/picketlink-bindings-jboss/src/test/java/org/picketlink/test/identity/federation/bindings/jboss/auth/SAML2STSLoginModuleUnitTestCase.java
===================================================================
---
federation/trunk/picketlink-bindings-jboss/src/test/java/org/picketlink/test/identity/federation/bindings/jboss/auth/SAML2STSLoginModuleUnitTestCase.java 2011-06-08
01:28:14 UTC (rev 983)
+++
federation/trunk/picketlink-bindings-jboss/src/test/java/org/picketlink/test/identity/federation/bindings/jboss/auth/SAML2STSLoginModuleUnitTestCase.java 2011-06-08
04:17:28 UTC (rev 984)
@@ -65,7 +65,6 @@
@Before
public void setup()
{
- System.setProperty("PL_TEST", "true");
System.setProperty("java.security.debug", "true");
Configuration.setConfiguration(new Configuration()
@@ -79,6 +78,7 @@
options.put("configFile", "sts-client.properties");
options.put("localValidation", "true");
options.put("localValidationSecurityDomain", "someSD");
+ options.put("localTestingOnly", "true");
AppConfigurationEntry a2 = new
AppConfigurationEntry(SAML2STSLoginModule.class.getName(),
LoginModuleControlFlag.REQUIRED, options);
Show replies by date