Picketlink SVN: r347 - in idm/branches/1.1.0: picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap and 1 other directories.
by picketlink-commits@lists.jboss.org
Author: bdaw
Date: 2010-08-09 10:28:40 -0400 (Mon, 09 Aug 2010)
New Revision: 347
Modified:
idm/branches/1.1.0/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/store/CommonIdentityStoreTest.java
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
idm/branches/1.1.0/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/api/APILDAPTestCase.java
Log:
- PLIDM-21 - LDAP search is not case sensitive
Modified: idm/branches/1.1.0/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/store/CommonIdentityStoreTest.java
===================================================================
--- idm/branches/1.1.0/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/store/CommonIdentityStoreTest.java 2010-08-09 14:18:55 UTC (rev 346)
+++ idm/branches/1.1.0/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/store/CommonIdentityStoreTest.java 2010-08-09 14:28:40 UTC (rev 347)
@@ -148,7 +148,13 @@
results = testContext.getStore().findIdentityObject(testContext.getCtx(), IdentityTypeEnum.ROLE, null);
assertEquals(0, results.size());
+ // Check case sensitive checks
+ assertNull(testContext.getStore().findIdentityObject(testContext.getCtx(), "adam", IdentityTypeEnum.USER));
+ assertNull(testContext.getStore().findIdentityObject(testContext.getCtx(), "ADAM", IdentityTypeEnum.USER));
+ assertNull(testContext.getStore().findIdentityObject(testContext.getCtx(), "deVISIon3", IdentityTypeEnum.ORGANIZATION));
+
+
testContext.commit();
}
Modified: idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
===================================================================
--- idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2010-08-09 14:18:55 UTC (rev 346)
+++ idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2010-08-09 14:28:40 UTC (rev 347)
@@ -620,6 +620,13 @@
String dn = ctx.getNameInNamespace();
IdentityObject io = createIdentityObjectInstance(invocationCtx, type, res.getAttributes(), dn);
ctx.close();
+
+ // Check for case insensitive name results
+ if (!io.getName().equals(name))
+ {
+ io = null;
+ }
+
return io;
}
Modified: idm/branches/1.1.0/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/api/APILDAPTestCase.java
===================================================================
--- idm/branches/1.1.0/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/api/APILDAPTestCase.java 2010-08-09 14:18:55 UTC (rev 346)
+++ idm/branches/1.1.0/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/api/APILDAPTestCase.java 2010-08-09 14:28:40 UTC (rev 347)
@@ -22,8 +22,11 @@
package org.picketlink.idm.impl.api;
+import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.api.IdentitySessionFactory;
+import org.picketlink.idm.api.User;
import org.picketlink.idm.impl.LDAPTestPOJO;
+import org.picketlink.idm.impl.api.model.SimpleUser;
import org.picketlink.idm.impl.configuration.IdentityConfigurationImpl;
@@ -117,4 +120,24 @@
{
roleQueryTest.testQuery(getRealmName());
}
+
+ public void testCaseSensitiveNames() throws Exception
+ {
+ IdentitySession session = identitySessionFactory.createIdentitySession(getRealmName());
+
+ begin();
+
+ User aaa = session.getPersistenceManager().createUser("aaa");
+ session.getAttributesManager().updatePassword(aaa, "bbb");
+
+ assertNull(session.getPersistenceManager().findUser("bbb"));
+ assertNotNull(session.getPersistenceManager().findUser("aaa"));
+ assertNull(session.getPersistenceManager().findUser("aAa"));
+
+ session.getAttributesManager().validatePassword(new SimpleUser("aAa"), "bbb");
+
+ assertNull(session.getPersistenceManager().findUser("aAa"));
+
+ commit();
+ }
}
\ No newline at end of file
14 years, 4 months
Picketlink SVN: r346 - in idm/trunk: picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap and 1 other directories.
by picketlink-commits@lists.jboss.org
Author: bdaw
Date: 2010-08-09 10:18:55 -0400 (Mon, 09 Aug 2010)
New Revision: 346
Modified:
idm/trunk/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/store/CommonIdentityStoreTest.java
idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
idm/trunk/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/api/APILDAPTestCase.java
Log:
- PLIDM-21 - LDAP search is not case sensitive
Modified: idm/trunk/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/store/CommonIdentityStoreTest.java
===================================================================
--- idm/trunk/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/store/CommonIdentityStoreTest.java 2010-08-09 11:17:53 UTC (rev 345)
+++ idm/trunk/picketlink-idm-core/src/test/java/org/picketlink/idm/impl/store/CommonIdentityStoreTest.java 2010-08-09 14:18:55 UTC (rev 346)
@@ -149,6 +149,12 @@
assertEquals(0, results.size());
+ // Check case sensitive checks
+
+ assertNull(testContext.getStore().findIdentityObject(testContext.getCtx(), "adam", IdentityTypeEnum.USER));
+ assertNull(testContext.getStore().findIdentityObject(testContext.getCtx(), "ADAM", IdentityTypeEnum.USER));
+ assertNull(testContext.getStore().findIdentityObject(testContext.getCtx(), "deVISIon3", IdentityTypeEnum.ORGANIZATION));
+
testContext.commit();
}
Modified: idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
===================================================================
--- idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2010-08-09 11:17:53 UTC (rev 345)
+++ idm/trunk/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2010-08-09 14:18:55 UTC (rev 346)
@@ -627,6 +627,13 @@
String dn = ctx.getNameInNamespace();
IdentityObject io = createIdentityObjectInstance(invocationCtx, type, res.getAttributes(), dn);
ctx.close();
+
+ // Check for case insensitive name results
+ if (!io.getName().equals(name))
+ {
+ io = null;
+ }
+
return io;
}
Modified: idm/trunk/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/api/APILDAPTestCase.java
===================================================================
--- idm/trunk/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/api/APILDAPTestCase.java 2010-08-09 11:17:53 UTC (rev 345)
+++ idm/trunk/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/api/APILDAPTestCase.java 2010-08-09 14:18:55 UTC (rev 346)
@@ -22,8 +22,11 @@
package org.picketlink.idm.impl.api;
+import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.api.IdentitySessionFactory;
+import org.picketlink.idm.api.User;
import org.picketlink.idm.impl.LDAPTestPOJO;
+import org.picketlink.idm.impl.api.model.SimpleUser;
import org.picketlink.idm.impl.configuration.IdentityConfigurationImpl;
@@ -117,4 +120,24 @@
{
roleQueryTest.testQuery(getRealmName());
}
+
+ public void testCaseSensitiveNames() throws Exception
+ {
+ IdentitySession session = identitySessionFactory.createIdentitySession(getRealmName());
+
+ begin();
+
+ User aaa = session.getPersistenceManager().createUser("aaa");
+ session.getAttributesManager().updatePassword(aaa, "bbb");
+
+ assertNull(session.getPersistenceManager().findUser("bbb"));
+ assertNotNull(session.getPersistenceManager().findUser("aaa"));
+ assertNull(session.getPersistenceManager().findUser("aAa"));
+
+ session.getAttributesManager().validatePassword(new SimpleUser("aAa"), "bbb");
+
+ assertNull(session.getPersistenceManager().findUser("aAa"));
+
+ commit();
+ }
}
\ No newline at end of file
14 years, 4 months
Picketlink SVN: r345 - idm/branches.
by picketlink-commits@lists.jboss.org
Author: bdaw
Date: 2010-08-09 07:17:53 -0400 (Mon, 09 Aug 2010)
New Revision: 345
Added:
idm/branches/1.5.0.Alpha01/
Log:
tag PLIDM 1.5.0.Alpha01
Copied: idm/branches/1.5.0.Alpha01 (from rev 344, idm/trunk)
14 years, 4 months
Picketlink SVN: r344 - idm/trunk/parent.
by picketlink-commits@lists.jboss.org
Author: bdaw
Date: 2010-08-09 06:39:57 -0400 (Mon, 09 Aug 2010)
New Revision: 344
Modified:
idm/trunk/parent/pom.xml
Log:
use jboss-parent v5
Modified: idm/trunk/parent/pom.xml
===================================================================
--- idm/trunk/parent/pom.xml 2010-08-04 21:12:05 UTC (rev 343)
+++ idm/trunk/parent/pom.xml 2010-08-09 10:39:57 UTC (rev 344)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss</groupId>
<artifactId>jboss-parent</artifactId>
- <version>3</version>
+ <version>5</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.picketlink.idm</groupId>
14 years, 4 months
Picketlink SVN: r343 - in federation/trunk: picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp and 5 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2010-08-04 17:12:05 -0400 (Wed, 04 Aug 2010)
New Revision: 343
Modified:
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPRedirectWithSignatureValve.java
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/BaseFormAuthenticator.java
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostSignatureFormAuthenticator.java
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/sig/SAML2Signature.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/filters/SPFilter.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2SignatureGenerationHandler.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/IDPServlet.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/util/IDPWebRequestUtil.java
Log:
Set the Canonicalization Method right at the configuration
Modified: federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPRedirectWithSignatureValve.java
===================================================================
--- federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPRedirectWithSignatureValve.java 2010-08-04 20:54:04 UTC (rev 342)
+++ federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPRedirectWithSignatureValve.java 2010-08-04 21:12:05 UTC (rev 343)
@@ -55,6 +55,7 @@
import org.picketlink.identity.federation.core.saml.v2.util.DocumentUtil;
import org.picketlink.identity.federation.core.util.CoreConfigUtil;
import org.picketlink.identity.federation.core.util.XMLEncryptionUtil;
+import org.picketlink.identity.federation.core.util.XMLSignatureUtil;
import org.picketlink.identity.federation.saml.v2.assertion.EncryptedElementType;
import org.picketlink.identity.federation.saml.v2.protocol.ResponseType;
import org.picketlink.identity.federation.web.util.RedirectBindingSignatureUtil;
@@ -108,6 +109,10 @@
keyManager.setAuthProperties( authProperties );
keyManager.setValidatingAlias(keyProvider.getValidatingAlias());
+ String canonicalizationMethod = idpConfiguration.getCanonicalizationMethod();
+
+ log.info( "IDPRedirectWithSignatureValve:: Setting the CanonicalizationMethod on XMLSignatureUtil::" + canonicalizationMethod );
+ XMLSignatureUtil.setCanonicalizationMethodType(canonicalizationMethod);
}
catch(Exception e)
{
Modified: federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java
===================================================================
--- federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java 2010-08-04 20:54:04 UTC (rev 342)
+++ federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java 2010-08-04 21:12:05 UTC (rev 343)
@@ -86,6 +86,7 @@
import org.picketlink.identity.federation.core.saml.v2.util.HandlerUtil;
import org.picketlink.identity.federation.core.util.CoreConfigUtil;
import org.picketlink.identity.federation.core.util.StringUtil;
+import org.picketlink.identity.federation.core.util.XMLSignatureUtil;
import org.picketlink.identity.federation.saml.v2.SAML2Object;
import org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType;
import org.picketlink.identity.federation.saml.v2.protocol.StatusResponseType;
@@ -547,8 +548,7 @@
if(isPost)
{
//Validate
- SAML2Signature samlSignature = new SAML2Signature();
- samlSignature.setCanonicalizationMethod(canonicalizationMethod);
+ SAML2Signature samlSignature = new SAML2Signature();
if( ignoreIncomingSignatures == false && signOutgoingMessages == true )
{
@@ -892,6 +892,8 @@
if(trace) log.trace("Identity Provider URL=" + this.identityURL);
this.assertionValidity = idpConfiguration.getAssertionValidity();
this.canonicalizationMethod = idpConfiguration.getCanonicalizationMethod();
+ log.info( "IDPWebBrowserSSOValve:: Setting the CanonicalizationMethod on XMLSignatureUtil::" + canonicalizationMethod );
+ XMLSignatureUtil.setCanonicalizationMethodType(canonicalizationMethod);
//Get the attribute manager
String attributeManager = idpConfiguration.getAttributeManager();
Modified: federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/BaseFormAuthenticator.java
===================================================================
--- federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/BaseFormAuthenticator.java 2010-08-04 20:54:04 UTC (rev 342)
+++ federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/BaseFormAuthenticator.java 2010-08-04 21:12:05 UTC (rev 343)
@@ -48,6 +48,7 @@
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerChainConfig;
import org.picketlink.identity.federation.core.saml.v2.util.HandlerUtil;
import org.picketlink.identity.federation.core.util.StringUtil;
+import org.picketlink.identity.federation.core.util.XMLSignatureUtil;
import org.picketlink.identity.federation.web.constants.GeneralConstants;
import org.picketlink.identity.federation.web.util.ConfigurationUtil;
@@ -157,6 +158,9 @@
this.identityURL = spConfiguration.getIdentityURL();
this.serviceURL = spConfiguration.getServiceURL();
this.canonicalizationMethod = spConfiguration.getCanonicalizationMethod();
+
+ log.info( "BaseFormAuthenticator:: Setting the CanonicalizationMethod on XMLSignatureUtil::" + canonicalizationMethod );
+ XMLSignatureUtil.setCanonicalizationMethodType(canonicalizationMethod);
if(trace) log.trace("Identity Provider URL=" + this.identityURL);
}
Modified: federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostSignatureFormAuthenticator.java
===================================================================
--- federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostSignatureFormAuthenticator.java 2010-08-04 20:54:04 UTC (rev 342)
+++ federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostSignatureFormAuthenticator.java 2010-08-04 21:12:05 UTC (rev 343)
@@ -120,8 +120,6 @@
//Sign the document
SAML2Signature samlSignature = new SAML2Signature();
KeyPair keypair = keyManager.getSigningKeyPair();
-
- samlSignature.setCanonicalizationMethod( this.canonicalizationMethod );
samlSignature.signSAMLDocument(samlDocument, keypair);
if(trace)
Modified: federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/sig/SAML2Signature.java
===================================================================
--- federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/sig/SAML2Signature.java 2010-08-04 20:54:04 UTC (rev 342)
+++ federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/sig/SAML2Signature.java 2010-08-04 21:12:05 UTC (rev 343)
@@ -57,8 +57,7 @@
public class SAML2Signature
{
private String signatureMethod = SignatureMethod.RSA_SHA1;
- private String digestMethod = DigestMethod.SHA1;
- private String canonicalizationMethod = CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS;
+ private String digestMethod = DigestMethod.SHA1;
public String getSignatureMethod()
@@ -80,26 +79,8 @@
{
this.digestMethod = digestMethod;
}
-
+
/**
- * Get the configured XML DSIG CanonicalizationMethod
- * @return
- */
- public String getCanonicalizationMethod()
- {
- return canonicalizationMethod;
- }
-
- /**
- * Set the XML DSIG Canonicalization Method
- * @param canonicalizationMethod
- */
- public void setCanonicalizationMethod(String canonicalizationMethod)
- {
- this.canonicalizationMethod = canonicalizationMethod;
- }
-
- /**
* Sign an RequestType at the root
* @param request
* @param keypair Key Pair
@@ -231,9 +212,6 @@
"ID",
idValueOfAssertion);
- //Set the configured canonicalization method
- XMLSignatureUtil.setCanonicalizationMethodType( canonicalizationMethod );
-
return XMLSignatureUtil.sign(doc, assertionNode,
keypair,
digestMethod, signatureMethod,
Modified: federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/filters/SPFilter.java
===================================================================
--- federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/filters/SPFilter.java 2010-08-04 20:54:04 UTC (rev 342)
+++ federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/filters/SPFilter.java 2010-08-04 21:12:05 UTC (rev 343)
@@ -455,6 +455,9 @@
this.identityURL = spConfiguration.getIdentityURL();
this.serviceURL = spConfiguration.getServiceURL();
this.canonicalizationMethod = spConfiguration.getCanonicalizationMethod();
+
+ log.info( "SPFilter:: Setting the CanonicalizationMethod on XMLSignatureUtil::" + canonicalizationMethod );
+ XMLSignatureUtil.setCanonicalizationMethodType(canonicalizationMethod);
log.trace("Identity Provider URL=" + this.identityURL);
}
@@ -608,8 +611,7 @@
{
if(!ignoreSignatures)
{
- SAML2Signature samlSignature = new SAML2Signature();
- samlSignature.setCanonicalizationMethod( canonicalizationMethod );
+ SAML2Signature samlSignature = new SAML2Signature();
KeyPair keypair = keyManager.getSigningKeyPair();
samlSignature.signSAMLDocument(samlDocument, keypair);
Modified: federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2SignatureGenerationHandler.java
===================================================================
--- federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2SignatureGenerationHandler.java 2010-08-04 20:54:04 UTC (rev 342)
+++ federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2SignatureGenerationHandler.java 2010-08-04 21:12:05 UTC (rev 343)
@@ -55,8 +55,7 @@
}
//Get the Key Pair
- KeyPair keypair = (KeyPair) this.handlerChainConfig.getParameter(GeneralConstants.KEYPAIR);
- String canonicalizationMethod = (String) this.handlerChainConfig.getParameter( GeneralConstants.CANONICALIZATION_METHOD );
+ KeyPair keypair = (KeyPair) this.handlerChainConfig.getParameter(GeneralConstants.KEYPAIR);
if(keypair == null)
{
@@ -64,7 +63,7 @@
throw new ProcessingException("KeyPair not found");
}
- sign(samlDocument, keypair, canonicalizationMethod );
+ sign(samlDocument, keypair );
}
public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException
@@ -81,9 +80,8 @@
//Get the Key Pair
KeyPair keypair = (KeyPair) this.handlerChainConfig.getParameter(GeneralConstants.KEYPAIR);
- String canonicalizationMethod = (String) this.handlerChainConfig.getParameter( GeneralConstants.CANONICALIZATION_METHOD );
-
- this.sign(responseDocument, keypair, canonicalizationMethod );
+
+ this.sign(responseDocument, keypair );
}
@Override
@@ -101,17 +99,14 @@
}
//Get the Key Pair
- KeyPair keypair = (KeyPair) this.handlerChainConfig.getParameter(GeneralConstants.KEYPAIR);
- String canonicalizationMethod = (String) this.handlerChainConfig.getParameter( GeneralConstants.CANONICALIZATION_METHOD );
-
- this.sign(responseDocument, keypair, canonicalizationMethod );
+ KeyPair keypair = (KeyPair) this.handlerChainConfig.getParameter(GeneralConstants.KEYPAIR);
+ this.sign(responseDocument, keypair );
}
- private void sign(Document samlDocument, KeyPair keypair, String canonicalizationMethod ) throws ProcessingException
+ private void sign(Document samlDocument, KeyPair keypair ) throws ProcessingException
{
- SAML2Signature samlSignature = new SAML2Signature();
- samlSignature.setCanonicalizationMethod(canonicalizationMethod);
+ SAML2Signature samlSignature = new SAML2Signature();
samlSignature.signSAMLDocument(samlDocument, keypair);
}
}
\ No newline at end of file
Modified: federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/IDPServlet.java
===================================================================
--- federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/IDPServlet.java 2010-08-04 20:54:04 UTC (rev 342)
+++ federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/IDPServlet.java 2010-08-04 21:12:05 UTC (rev 343)
@@ -73,6 +73,7 @@
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2Handler.HANDLER_TYPE;
import org.picketlink.identity.federation.core.saml.v2.util.HandlerUtil;
import org.picketlink.identity.federation.core.util.CoreConfigUtil;
+import org.picketlink.identity.federation.core.util.XMLSignatureUtil;
import org.picketlink.identity.federation.saml.v2.SAML2Object;
import org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType;
import org.picketlink.identity.federation.saml.v2.protocol.StatusResponseType;
@@ -153,6 +154,9 @@
this.assertionValidity = idpConfiguration.getAssertionValidity();
this.canonicalizationMethod = idpConfiguration.getCanonicalizationMethod();
+
+ log.info( "IDPServlet:: Setting the CanonicalizationMethod on XMLSignatureUtil::" + canonicalizationMethod );
+ XMLSignatureUtil.setCanonicalizationMethodType(canonicalizationMethod);
//Get the attribute manager
String attributeManager = idpConfiguration.getAttributeManager();
Modified: federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/util/IDPWebRequestUtil.java
===================================================================
--- federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/util/IDPWebRequestUtil.java 2010-08-04 20:54:04 UTC (rev 342)
+++ federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/util/IDPWebRequestUtil.java 2010-08-04 21:12:05 UTC (rev 343)
@@ -269,8 +269,7 @@
{
try
{
- SAML2Signature saml2Signature = new SAML2Signature();
- saml2Signature.setCanonicalizationMethod(canonicalizationMethod);
+ SAML2Signature saml2Signature = new SAML2Signature();
samlResponseDocument = saml2Signature.sign(responseType, keyManager.getSigningKeyPair());
}
catch (Exception e)
@@ -439,8 +438,7 @@
if(supportSignature)
{
//Sign the document
- SAML2Signature samlSignature = new SAML2Signature();
- samlSignature.setCanonicalizationMethod(canonicalizationMethod);
+ SAML2Signature samlSignature = new SAML2Signature();
KeyPair keypair = keyManager.getSigningKeyPair();
samlSignature.signSAMLDocument(responseDoc, keypair);
@@ -563,8 +561,7 @@
{
try
{
- SAML2Signature ss = new SAML2Signature();
- ss.setCanonicalizationMethod(canonicalizationMethod);
+ SAML2Signature ss = new SAML2Signature();
samlResponse = ss.sign(responseType, keyManager.getSigningKeyPair());
}
catch (Exception e)
14 years, 4 months
Picketlink SVN: r342 - federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2010-08-04 16:54:04 -0400 (Wed, 04 Aug 2010)
New Revision: 342
Modified:
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostFormAuthenticator.java
Log:
PLFED-101: set the key manager
Modified: federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostFormAuthenticator.java
===================================================================
--- federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostFormAuthenticator.java 2010-08-02 15:33:44 UTC (rev 341)
+++ federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostFormAuthenticator.java 2010-08-04 20:54:04 UTC (rev 342)
@@ -193,6 +193,8 @@
ServiceProviderSAMLResponseProcessor responseProcessor =
new ServiceProviderSAMLResponseProcessor(true, serviceURL);
responseProcessor.setValidateSignature( validateSignature );
+ responseProcessor.setTrustKeyManager(keyManager);
+
SAML2HandlerResponse saml2HandlerResponse =
responseProcessor.process(samlResponse, httpContext, handlers, chainLock);
14 years, 4 months
Picketlink SVN: r341 - in idm/trunk: picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: bdaw
Date: 2010-08-02 11:33:44 -0400 (Mon, 02 Aug 2010)
New Revision: 341
Modified:
idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/store/FeaturesMetaDataImpl.java
idm/trunk/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java
Log:
PLIDM-20 - FeaturesMetaDataImpl.getSupportedRelationshipTypes() doesn't return correct data in some cases
Modified: idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/store/FeaturesMetaDataImpl.java
===================================================================
--- idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/store/FeaturesMetaDataImpl.java 2010-08-02 15:13:53 UTC (rev 340)
+++ idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/store/FeaturesMetaDataImpl.java 2010-08-02 15:33:44 UTC (rev 341)
@@ -60,6 +60,7 @@
// <Relationship Type, <From IdentityType, To IdentityType>>
private final Map<String, Map<String, Set<String>>> supportedRelationshipMappings = new HashMap<String, Map<String, Set<String>>>();
+ private final Set<String> supportedRelationshipTypes = new HashSet<String>();
public FeaturesMetaDataImpl(IdentityStoreConfigurationMetaData configurationMD,
Set<IdentityObjectSearchCriteriaType> supportedCriteria,
@@ -97,6 +98,12 @@
// Supported relationships
+ for (String type : configurationMD.getSupportedRelationshipTypes())
+ {
+ supportedRelationshipTypes.add(type);
+ }
+
+
for (IdentityObjectTypeMetaData identityObjectTypeMetaData : configurationMD.getSupportedIdentityTypes())
{
String fromTypeName = identityObjectTypeMetaData.getName();
@@ -139,7 +146,7 @@
toTypes.add(toTypeName);
-
+
}
@@ -211,7 +218,7 @@
public Set<String> getSupportedRelationshipTypes()
{
- return supportedRelationshipMappings.keySet();
+ return Collections.unmodifiableSet(supportedRelationshipTypes);
}
public boolean isCredentialSupported(IdentityObjectType identityObjectType, IdentityObjectCredentialType credentialType)
Modified: idm/trunk/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java
===================================================================
--- idm/trunk/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2010-08-02 15:13:53 UTC (rev 340)
+++ idm/trunk/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2010-08-02 15:33:44 UTC (rev 341)
@@ -344,6 +344,11 @@
}
+ public void testMD() throws Exception
+ {
+ assertEquals(2, store.getSupportedFeatures().getSupportedRelationshipTypes().size());
+ }
+
public void testRelationships() throws Exception
{
commonTest.testRelationships();
14 years, 4 months
Picketlink SVN: r340 - in idm/branches/1.1.0: picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: bdaw
Date: 2010-08-02 11:13:53 -0400 (Mon, 02 Aug 2010)
New Revision: 340
Modified:
idm/branches/1.1.0/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/store/FeaturesMetaDataImpl.java
idm/branches/1.1.0/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java
Log:
PLIDM-20 - FeaturesMetaDataImpl.getSupportedRelationshipTypes() doesn't return correct data in some cases
Modified: idm/branches/1.1.0/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/store/FeaturesMetaDataImpl.java
===================================================================
--- idm/branches/1.1.0/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/store/FeaturesMetaDataImpl.java 2010-07-29 20:04:34 UTC (rev 339)
+++ idm/branches/1.1.0/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/store/FeaturesMetaDataImpl.java 2010-08-02 15:13:53 UTC (rev 340)
@@ -60,6 +60,7 @@
// <Relationship Type, <From IdentityType, To IdentityType>>
private final Map<String, Map<String, Set<String>>> supportedRelationshipMappings = new HashMap<String, Map<String, Set<String>>>();
+ private final Set<String> supportedRelationshipTypes = new HashSet<String>();
public FeaturesMetaDataImpl(IdentityStoreConfigurationMetaData configurationMD,
Set<IdentityObjectSearchCriteriaType> supportedCriteria,
@@ -97,6 +98,12 @@
// Supported relationships
+ for (String type : configurationMD.getSupportedRelationshipTypes())
+ {
+ supportedRelationshipTypes.add(type);
+ }
+
+
for (IdentityObjectTypeMetaData identityObjectTypeMetaData : configurationMD.getSupportedIdentityTypes())
{
String fromTypeName = identityObjectTypeMetaData.getName();
@@ -211,7 +218,7 @@
public Set<String> getSupportedRelationshipTypes()
{
- return supportedRelationshipMappings.keySet();
+ return Collections.unmodifiableSet(supportedRelationshipTypes);
}
public boolean isCredentialSupported(IdentityObjectType identityObjectType, IdentityObjectCredentialType credentialType)
Modified: idm/branches/1.1.0/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java
===================================================================
--- idm/branches/1.1.0/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2010-07-29 20:04:34 UTC (rev 339)
+++ idm/branches/1.1.0/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2010-08-02 15:13:53 UTC (rev 340)
@@ -344,6 +344,11 @@
}
+ public void testMD() throws Exception
+ {
+ assertEquals(2, store.getSupportedFeatures().getSupportedRelationshipTypes().size());
+ }
+
public void testRelationships() throws Exception
{
commonTest.testRelationships();
14 years, 4 months