Author: dimuthul
Date: Thu Jan 31 22:26:27 2008
New Revision: 13214
Log:
Adding jars required for opensaml.
The team decided to add the libs to the svn until they are available online.
Added:
trunk/solutions/identity/modules/lib/
trunk/solutions/identity/modules/lib/opensaml-2.0-rc1.jar (contents, props
changed)
trunk/solutions/identity/modules/lib/openws-2.0-rc1.jar (contents, props
changed)
trunk/solutions/identity/modules/lib/xmltooling-2.0-rc1.jar (contents,
props changed)
Modified:
trunk/solutions/identity/modules/identity-provider/pom.xml
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/sts/saml/SAML1TokenBuilder.java
trunk/solutions/identity/modules/samples/pom.xml
trunk/solutions/identity/modules/token-verifier-core/pom.xml
Modified: trunk/solutions/identity/modules/identity-provider/pom.xml
==============================================================================
--- trunk/solutions/identity/modules/identity-provider/pom.xml (original)
+++ trunk/solutions/identity/modules/identity-provider/pom.xml Thu Jan 31
22:26:27 2008
@@ -21,9 +21,6 @@
<configuration>
<source>1.5</source>
<target>1.5</target>
- <excludes>
- <exclude>org/wso2/solutions/identity/sts/saml/*</exclude>
- </excludes>
</configuration>
</plugin>
</plugins>
@@ -91,6 +88,86 @@
<artifactId>openid4java-nodeps</artifactId>
<version>0.9.5-SNAPSHOT</version>
</dependency>
+<!-- Begin opensaml-2.0 jars -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>${jodatime.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>oro</groupId>
+ <artifactId>oro</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jdom</groupId>
+ <artifactId>jdom</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>logkit</groupId>
+ <artifactId>logkit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>werken-xpath</groupId>
+ <artifactId>werken-xpath</artifactId>
+ </exclusion>
+ </exclusions>
+ <version>${velocity.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ <version>2.0-rc1</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/../lib/opensaml-2.0-rc1.jar</systemPath>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>2.0-rc1</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/../lib/openws-2.0-rc1.jar</systemPath>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>2.0-rc1</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/../lib/xmltooling-2.0-rc1.jar</systemPath>
+ </dependency>
+
+ <!-- End opensaml-2.0 jars -->
</dependencies>
</project>
Modified:
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/sts/saml/SAML1TokenBuilder.java
==============================================================================
---
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/sts/saml/SAML1TokenBuilder.java
(original)
+++
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/sts/saml/SAML1TokenBuilder.java
Thu Jan 31 22:26:27 2008
@@ -2,17 +2,19 @@
import java.io.FileInputStream;
import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import javax.xml.crypto.dsig.CanonicalizationMethod;
import javax.xml.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.rahas.RahasData;
+import org.apache.xml.security.c14n.Canonicalizer;
import org.apache.xml.security.signature.XMLSignature;
import org.joda.time.DateTime;
import org.opensaml.saml1.core.Assertion;
@@ -43,6 +45,8 @@
import org.wso2.solutions.identity.sts.IdentityProviderData;
import org.wso2.solutions.identity.sts.IdentityProviderData.RequestedClaimData;
+import com.ibm.wsdl.util.xml.DOM2Writer;
+
public class SAML1TokenBuilder implements SAMLTokenBuilder {
private static Log log = LogFactory.getLog(SAML2TokenBuilder.class);
@@ -84,7 +88,9 @@
confMethod.setConfirmationMethod(CONF_KEY);
subjectConf.getConfirmationMethods().add(confMethod);
subject.setSubjectConfirmation(subjectConf);
-
+
+ attributeStmt.setSubject(subject);
+
Map mapClaims = ipData.getRequestedClaims();
Iterator ite = mapClaims.values().iterator();
@@ -127,7 +133,7 @@
Conditions conditions = (Conditions)
buildXMLObject(Conditions.DEFAULT_ELEMENT_NAME);
conditions.setNotBefore(notBefore);
conditions.setNotOnOrAfter(notAfter);
-
+ assertion.setIssuer("http://localhost");
/*
* TODO : is this needed ??? AudienceRestriction audience =
* (AudienceRestriction)
@@ -146,15 +152,14 @@
Signature signature = (Signature)
buildXMLObject(Signature.DEFAULT_ELEMENT_NAME);
signature.setSigningCredential(cred);
signature.setSignatureAlgorithm(XMLSignature.ALGO_ID_SIGNATURE_RSA);
- signature
-
.setCanonicalizationAlgorithm(CanonicalizationMethod.INCLUSIVE);
+
signature.setCanonicalizationAlgorithm(Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
+ System.out.println("*********** excl ********* ");
assertion.setSignature(signature);
signatureList.add(signature);
}
public void marshellAndSign() throws IdentityProviderException {
-
try {
MarshallerFactory marshallerFactory = Configuration
.getMarshallerFactory();
@@ -167,10 +172,22 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
-
}
public Element getSAMLasDOM() throws IdentityProviderException {
+
+ try {
+ String val = DOM2Writer.nodeToString(signedAssertion);
+ FileWriter out = new FileWriter("before-saml.xml");
+ out.write(val);
+ out.flush();
+ out.close();
+ System.out.println("***wrote to file********");
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
return signedAssertion;
}
Added: trunk/solutions/identity/modules/lib/opensaml-2.0-rc1.jar
==============================================================================
Binary file. No diff available.
Added: trunk/solutions/identity/modules/lib/openws-2.0-rc1.jar
==============================================================================
Binary file. No diff available.
Added: trunk/solutions/identity/modules/lib/xmltooling-2.0-rc1.jar
==============================================================================
Binary file. No diff available.
Modified: trunk/solutions/identity/modules/samples/pom.xml
==============================================================================
--- trunk/solutions/identity/modules/samples/pom.xml (original)
+++ trunk/solutions/identity/modules/samples/pom.xml Thu Jan 31 22:26:27 2008
@@ -20,7 +20,6 @@
<version>${pom.version}</version>
</dependency>
</dependencies>
-
<modules>
<module>servlet-filter</module>
</modules>
Modified: trunk/solutions/identity/modules/token-verifier-core/pom.xml
==============================================================================
--- trunk/solutions/identity/modules/token-verifier-core/pom.xml
(original)
+++ trunk/solutions/identity/modules/token-verifier-core/pom.xml Thu Jan
31 22:26:27 2008
@@ -57,7 +57,90 @@
<groupId>org.openid4java</groupId>
<artifactId>openid4java-nodeps</artifactId>
<version>0.9.5-SNAPSHOT</version>
- </dependency>
+ </dependency>
+
+ <!-- Begin opensaml-2.0 jars -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>${jodatime.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>oro</groupId>
+ <artifactId>oro</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jdom</groupId>
+ <artifactId>jdom</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>logkit</groupId>
+ <artifactId>logkit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>werken-xpath</groupId>
+ <artifactId>werken-xpath</artifactId>
+ </exclusion>
+ </exclusions>
+ <version>${velocity.version}</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ <version>2.0-rc1</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/../lib/opensaml-2.0-rc1.jar</systemPath>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>2.0-rc1</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/../lib/openws-2.0-rc1.jar</systemPath>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>2.0-rc1</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/../lib/xmltooling-2.0-rc1.jar</systemPath>
+ </dependency>
+
+ <!-- End opensaml-2.0 jars -->
+
</dependencies>
</project>
_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev