You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2017/01/31 00:17:20 UTC
svn commit: r1781009 [6/7] - in
/axis/axis2/java/rampart/branches/RAMPART-385: ./ apidocs/ code-coverage/
etc/ modules/distribution/ modules/distribution/src/ modules/documentation/
modules/rampart-core/ modules/rampart-core/src/main/java/META-INF/ mod...
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/policy.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/policy.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/policy.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/policy.xml Tue Jan 31 00:17:19 2017
@@ -35,7 +35,7 @@
<wsp:Policy>
<sp:IssuedToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
<Issuer xmlns="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
- <Address xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8080/axis2/services/STS</Address>
+ <Address xmlns="http://www.w3.org/2005/08/addressing">http://localhost:@port@/axis2/services/STS</Address>
<Metadata xmlns="http://www.w3.org/2005/08/addressing">
<mex:Metadata
xmlns:mex="http://schemas.xmlsoap.org/ws/2004/09/mex"
@@ -43,7 +43,7 @@
<mex:MetadataSection Dialect="http://schemas.xmlsoap.org/ws/2004/09/mex">
<mex:MetadataReference>
<Address
- xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8080/axis2/services/mex</Address>
+ xmlns="http://www.w3.org/2005/08/addressing">http://localhost:@port@/axis2/services/mex</Address>
</mex:MetadataReference>
</mex:MetadataSection>
</mex:Metadata>
@@ -104,4 +104,4 @@
</ramp:RampartConfig>
</wsp:All>
</wsp:ExactlyOne>
-</wsp:Policy>
\ No newline at end of file
+</wsp:Policy>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/services.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/services.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/services.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/services.xml Tue Jan 31 00:17:19 2017
@@ -183,7 +183,7 @@
<mex:MetadataSection Dialect="http://schemas.xmlsoap.org/ws/2004/09/mex">
<mex:MetadataReference>
<Address
- xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8080/axis2/services/mex</Address>
+ xmlns="http://www.w3.org/2005/08/addressing">http://localhost:@port@/axis2/services/mex</Address>
</mex:MetadataReference>
</mex:MetadataSection>
</mex:Metadata>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/src/org/apache/rampart/samples/policy/sample06/Client.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/src/org/apache/rampart/samples/policy/sample06/Client.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/src/org/apache/rampart/samples/policy/sample06/Client.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/src/org/apache/rampart/samples/policy/sample06/Client.java Tue Jan 31 00:17:19 2017
@@ -20,7 +20,8 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
@@ -35,6 +36,7 @@ import org.apache.rampart.RampartMessage
import org.apache.ws.secpolicy.SP11Constants;
import org.opensaml.common.xml.SAMLConstants;
+import java.io.FileInputStream;
import javax.xml.namespace.QName;
@@ -67,7 +69,7 @@ public class Client {
}
private static Policy loadPolicy(String xmlPath) throws Exception {
- StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
+ OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(new FileInputStream(xmlPath));
return PolicyEngine.getPolicy(builder.getDocumentElement());
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/src/org/apache/rampart/samples/policy/sample06/MexService.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/src/org/apache/rampart/samples/policy/sample06/MexService.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/src/org/apache/rampart/samples/policy/sample06/MexService.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample06/src/org/apache/rampart/samples/policy/sample06/MexService.java Tue Jan 31 00:17:19 2017
@@ -22,10 +22,9 @@ import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
-import javax.xml.stream.XMLStreamException;
-
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axis2.AxisFault;
import org.apache.axis2.mex.MexConstants;
import org.apache.axis2.mex.om.Metadata;
@@ -56,12 +55,10 @@ public class MexService {
File file = new File("sample06/mex_policy.xml");
System.out.println(file.getAbsolutePath());
- StAXOMBuilder builder = new StAXOMBuilder(new FileInputStream(file));
+ OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(new FileInputStream(file));
return builder.getDocumentElement();
} catch (FileNotFoundException e) {
throw new AxisFault("Error reading the file",e);
- } catch (XMLStreamException e) {
- throw new AxisFault("Error parsing the file",e);
}
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample07/src/org/apache/rampart/samples/policy/sample07/Client.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample07/src/org/apache/rampart/samples/policy/sample07/Client.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample07/src/org/apache/rampart/samples/policy/sample07/Client.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample07/src/org/apache/rampart/samples/policy/sample07/Client.java Tue Jan 31 00:17:19 2017
@@ -20,7 +20,8 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
@@ -30,6 +31,8 @@ import org.apache.neethi.Policy;
import org.apache.neethi.PolicyEngine;
import org.apache.rampart.RampartMessageData;
+import java.io.FileInputStream;
+
import javax.xml.namespace.QName;
public class Client {
@@ -59,7 +62,7 @@ public class Client {
}
private static Policy loadPolicy(String xmlPath) throws Exception {
- StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
+ OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(new FileInputStream(xmlPath));
return PolicyEngine.getPolicy(builder.getDocumentElement());
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample08/policy.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample08/policy.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample08/policy.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample08/policy.xml Tue Jan 31 00:17:19 2017
@@ -35,7 +35,7 @@
<wsp:Policy>
<sp:IssuedToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
<Issuer xmlns="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
- <Address xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8080/axis2/services/STS</Address>
+ <Address xmlns="http://www.w3.org/2005/08/addressing">http://localhost:@port@/axis2/services/STS</Address>
</Issuer>
<sp:RequestSecurityTokenTemplate>
<t:TokenType xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust">http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</t:TokenType>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample08/src/org/apache/rampart/samples/policy/sample08/Client.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample08/src/org/apache/rampart/samples/policy/sample08/Client.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample08/src/org/apache/rampart/samples/policy/sample08/Client.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/policy/sample08/src/org/apache/rampart/samples/policy/sample08/Client.java Tue Jan 31 00:17:19 2017
@@ -19,7 +19,8 @@ package org.apache.rampart.samples.polic
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.neethi.Policy;
@@ -31,6 +32,9 @@ import org.apache.rahas.client.STSClient
import org.apache.ws.secpolicy.SP11Constants;
import org.opensaml.common.xml.SAMLConstants;
+import java.io.FileInputStream;
+import java.net.URL;
+
import javax.xml.namespace.QName;
public class Client {
@@ -49,7 +53,7 @@ public class Client {
String action = TrustUtil.getActionValue(RahasConstants.VERSION_05_02, RahasConstants.RST_ACTION_ISSUE);
stsClient.setAction(action);
- Token responseToken = stsClient.requestSecurityToken(loadPolicy("sample08/policy.xml"), "http://localhost:8080/axis2/services/STS", loadPolicy("sample08/sts_policy.xml"), null);
+ Token responseToken = stsClient.requestSecurityToken(loadPolicy("sample08/policy.xml"), new URL(new URL(args[0]), "/axis2/services/STS").toString(), loadPolicy("sample08/sts_policy.xml"), null);
System.out.println("\n############################# Requested SAML 2.0 Token ###################################\n");
System.out.println(responseToken.getToken().toString());
@@ -59,7 +63,7 @@ public class Client {
}
private static Policy loadPolicy(String xmlPath) throws Exception {
- StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
+ OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(new FileInputStream(xmlPath));
return PolicyEngine.getPolicy(builder.getDocumentElement());
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/pom.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/pom.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-samples/pom.xml Tue Jan 31 00:17:19 2017
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-project</artifactId>
- <version>1.7.0-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -37,76 +37,146 @@
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-agent-for-client</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+ <propertyName>jacoco.argLineTemplate</propertyName>
+ <sessionId>mvn:${project.groupId}:${project.artifactId}:${project.version}:@id@</sessionId>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-repo-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>create-test-repository</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/axis2/repository</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.7</version>
+ <artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
- <phase>generate-sources</phase>
+ <id>copy-dependencies</id>
+ <phase>generate-test-resources</phase>
<goals>
- <goal>add-source</goal>
+ <goal>copy-dependencies</goal>
</goals>
<configuration>
- <sources>
- <source>basic/sample01/src</source>
- <source>basic/sample02/src</source>
- <source>basic/sample03/src</source>
- <source>basic/sample04/src</source>
- <source>basic/sample05/src</source>
- <source>basic/sample06/src</source>
- <source>basic/sample07/src</source>
- <source>basic/sample08/src</source>
- <source>basic/sample09/src</source>
- <source>basic/sample10/src</source>
- <source>basic/sample11/src</source>
- <source>policy/sample01/src</source>
- <source>policy/sample02/src</source>
- <source>policy/sample03/src</source>
- <source>policy/sample04/src</source>
- <source>policy/sample05/src</source>
- <source>policy/sample06/src</source>
- <source>policy/sample07/src</source>
- <source>policy/sample08/src</source>
- <source>policy/sample-tomcat/src</source>
- </sources>
+ <outputDirectory>${project.build.directory}/axis2/lib</outputDirectory>
+ <includeTypes>jar</includeTypes>
</configuration>
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <jacoco.argLineTemplate>${jacoco.argLineTemplate}</jacoco.argLineTemplate>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
</plugins>
</build>
<dependencies>
<dependency>
- <groupId>org.apache.rampart</groupId>
- <artifactId>rampart-policy</artifactId>
- <version>${project.version}</version>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.rampart</groupId>
- <artifactId>rampart-trust</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.rampart</groupId>
- <artifactId>rampart-core</artifactId>
- <version>${project.version}</version>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>1.9.6</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.7.0</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>addressing</artifactId>
+ <type>mar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rampart</artifactId>
+ <version>${project.version}</version>
+ <type>mar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rahas</artifactId>
+ <version>${project.version}</version>
+ <type>mar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-transport-http</artifactId>
+ <version>${axis2.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-transport-local</artifactId>
+ <version>${axis2.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-adb</artifactId>
+ <version>${axis2.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-testutils</artifactId>
+ <version>${axis2.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rampart-core</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
</dependency>
</dependencies>
</project>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/pom.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/pom.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/pom.xml Tue Jan 31 00:17:19 2017
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-project</artifactId>
- <version>1.7.0-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -48,11 +48,9 @@
</testResources>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
+ <artifactId>maven-deploy-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <skip>true</skip>
</configuration>
</plugin>
</plugins>
@@ -82,20 +80,10 @@
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>2.0-beta-5</version>
- <configuration>
- <templateDirectory>${basedir}</templateDirectory>
- <menu ref="parent" />
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
</project>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rahas/SimpleTokenStoreTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rahas/SimpleTokenStoreTest.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rahas/SimpleTokenStoreTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rahas/SimpleTokenStoreTest.java Tue Jan 31 00:17:19 2017
@@ -23,9 +23,8 @@ import org.apache.axiom.om.OMNamespace;
import junit.framework.TestCase;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Date;
@@ -156,7 +155,6 @@ public class SimpleTokenStoreTest extend
public void testSerialize()
throws Exception {
- String fileName = "test.ser";
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns1 = factory.createOMNamespace("bar", "x");
@@ -167,30 +165,13 @@ public class SimpleTokenStoreTest extend
SimpleTokenStore store = new SimpleTokenStore();
store.add(t);
- FileOutputStream fos = null;
- ObjectOutputStream out = null;
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(baos);
- try {
- fos = new FileOutputStream(fileName);
- out = new ObjectOutputStream(fos);
- out.writeObject(store);
- } finally {
- out.close();
- }
-
- SimpleTokenStore store2 = null;
- FileInputStream fis = null;
- ObjectInputStream in = null;
- try {
- fis = new FileInputStream(fileName);
- in = new ObjectInputStream(fis);
- store2 = (SimpleTokenStore)in.readObject();
- in.close();
- } catch (IOException ex) {
- ex.printStackTrace();
- } catch (ClassNotFoundException ex) {
- ex.printStackTrace();
- }
+ out.writeObject(store);
+
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
+ SimpleTokenStore store2 = (SimpleTokenStore)in.readObject();
assertEquals(store.getToken("#1232122").getId(), store2.getToken("#1232122").getId());
assertEquals(store.getToken("#1232122").getCreated(), store2.getToken("#1232122").getCreated());
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/AsymmetricBindingBuilderTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/AsymmetricBindingBuilderTest.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/AsymmetricBindingBuilderTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/AsymmetricBindingBuilderTest.java Tue Jan 31 00:17:19 2017
@@ -38,7 +38,7 @@ public class AsymmetricBindingBuilderTes
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.WSSE_NS, WSConstants.BINARY_TOKEN_LN));
@@ -59,7 +59,7 @@ public class AsymmetricBindingBuilderTes
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.SIG_NS, WSConstants.SIG_LN));
@@ -79,7 +79,7 @@ public class AsymmetricBindingBuilderTes
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.WSSE_NS, WSConstants.BINARY_TOKEN_LN));
@@ -102,7 +102,7 @@ public class AsymmetricBindingBuilderTes
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.WSSE_NS, WSConstants.BINARY_TOKEN_LN));
@@ -124,7 +124,7 @@ public class AsymmetricBindingBuilderTes
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.ENC_NS, WSConstants.ENC_KEY_LN));
@@ -148,7 +148,7 @@ public class AsymmetricBindingBuilderTes
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.ENC_NS, WSConstants.ENC_KEY_LN));
@@ -170,7 +170,7 @@ public class AsymmetricBindingBuilderTes
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.ENC_NS, WSConstants.ENC_KEY_LN));
@@ -191,7 +191,7 @@ public class AsymmetricBindingBuilderTes
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.WSSE_NS,WSConstants.BINARY_TOKEN_LN));
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/MessageBuilderTestBase.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/MessageBuilderTestBase.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/MessageBuilderTestBase.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/MessageBuilderTestBase.java Tue Jan 31 00:17:19 2017
@@ -20,8 +20,6 @@ import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAP11Constants;
-import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axis2.AxisFault;
import org.apache.axis2.client.Options;
import org.apache.axis2.context.ConfigurationContext;
@@ -74,7 +72,7 @@ public class MessageBuilderTestBase exte
* @throws AxisFault
*/
protected MessageContext getMsgCtx12() throws Exception {
- return initMsgCtxFromMessage("test-resources/policy/soapmessage.xml");
+ return initMsgCtxFromMessage("test-resources/policy/soapmessage12.xml");
}
/**
@@ -116,7 +114,7 @@ public class MessageBuilderTestBase exte
return PolicyEngine.getPolicy(builder.getDocumentElement());
}
- protected void verifySecHeader(Iterator qnameList, SOAPEnvelope env) {
+ protected void verifySecHeader(Iterator<QName> qnameList, SOAPEnvelope env) {
Iterator secHeaderChildren =
env.getHeader().
getFirstChildWithName(new QName(WSConstants.WSSE_NS,
@@ -139,16 +137,4 @@ public class MessageBuilderTestBase exte
"next expected element" + qnameList.next().toString());
}
}
-
- public String getContentTypeForEnvelope(SOAPEnvelope env) {
- String contentType = SOAP11Constants.SOAP_11_CONTENT_TYPE; //default
- if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(env.getNamespace().getNamespaceURI())) {
- contentType = SOAP11Constants.SOAP_11_CONTENT_TYPE;
- }
- else if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(env.getNamespace().getNamespaceURI())) {
- contentType = SOAP12Constants.SOAP_12_CONTENT_TYPE;
- }
- return contentType;
- }
-
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/PolicyAssertionsTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/PolicyAssertionsTest.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/PolicyAssertionsTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/PolicyAssertionsTest.java Tue Jan 31 00:17:19 2017
@@ -16,7 +16,9 @@ package org.apache.rampart;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axis2.builder.SOAPBuilder;
import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisService;
import org.apache.neethi.Policy;
+import org.apache.ws.security.handler.WSHandlerConstants;
import java.io.ByteArrayInputStream;
@@ -78,6 +80,82 @@ public class PolicyAssertionsTest extend
} catch (RampartException expected) {
// Ignore intentionally as the test is supposed to throw an exception
}
+
+ }
+
+ public void testHashedPasswordRequiredValid() throws Exception {
+
+ MessageContext ctx = getMsgCtx();
+
+ String policyXml = "test-resources/policy/rampart-hashed-password.xml";
+ Policy policy = loadPolicy(policyXml);
+
+ ctx.setProperty(RampartMessageData.KEY_RAMPART_POLICY, policy);
+
+ ctx.getOptions().setUserName( "Ron" );
+ ctx.getOptions().setPassword( "noR" );
+
+ MessageBuilder builder = new MessageBuilder();
+ builder.build(ctx);
+
+ // Building the SOAP envelope from the OMElement
+ SOAPBuilder soapBuilder = new SOAPBuilder();
+ SOAPEnvelope env = ctx.getEnvelope();
+ ByteArrayInputStream inStream = new ByteArrayInputStream(env.toString().getBytes());
+ env = (SOAPEnvelope) soapBuilder.processDocument(inStream, "text/xml", ctx);
+ ctx.setEnvelope(env);
+
+ ctx.setServerSide(true);
+ AxisService axisService = ctx.getAxisService();
+ axisService.removeParameter(axisService.getParameter(RampartMessageData.PARAM_CLIENT_SIDE));
+
+ ctx.setProperty(WSHandlerConstants.PW_CALLBACK_REF, new TestCBHandler());
+
+ RampartEngine engine = new RampartEngine();
+ engine.process(ctx);
+
+ }
+
+ public void testHashedPasswordRequiredInvalid() throws Exception {
+
+ MessageContext ctx = getMsgCtx();
+
+ String policyXml = "test-resources/policy/rampart-plaintext-password.xml";
+ Policy policy = loadPolicy(policyXml);
+
+ ctx.setProperty(RampartMessageData.KEY_RAMPART_POLICY, policy);
+
+ ctx.getOptions().setUserName( "Ron" );
+ ctx.getOptions().setPassword( "noR" );
+
+ MessageBuilder builder = new MessageBuilder();
+ builder.build(ctx);
+
+ // Building the SOAP envelope from the OMElement
+ SOAPBuilder soapBuilder = new SOAPBuilder();
+ SOAPEnvelope env = ctx.getEnvelope();
+ ByteArrayInputStream inStream = new ByteArrayInputStream(env.toString().getBytes());
+ env = (SOAPEnvelope) soapBuilder.processDocument(inStream, "text/xml", ctx);
+ ctx.setEnvelope(env);
+
+ ctx.setServerSide(true);
+ AxisService axisService = ctx.getAxisService();
+ axisService.removeParameter(axisService.getParameter(RampartMessageData.PARAM_CLIENT_SIDE));
+
+ policyXml = "test-resources/policy/rampart-hashed-password.xml";
+ policy = loadPolicy(policyXml);
+
+ ctx.setProperty(RampartMessageData.KEY_RAMPART_POLICY, policy);
+ ctx.setProperty(WSHandlerConstants.PW_CALLBACK_REF, new TestCBHandler());
+
+ RampartEngine engine = new RampartEngine();
+
+ try {
+ engine.process(ctx);
+ fail(" This should have thrown RampartException: Invalid UsernameToken Type.");
+ } catch (RampartException expected) {
+ // Ignore intentionally as the test is supposed to throw an exception
+ }
}
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/RampartEngineTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/RampartEngineTest.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/RampartEngineTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/RampartEngineTest.java Tue Jan 31 00:17:19 2017
@@ -26,74 +26,41 @@ import org.apache.axis2.context.MessageC
import org.apache.neethi.Policy;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSSecurityEngineResult;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+@RunWith(JUnit4.class)
public class RampartEngineTest extends MessageBuilderTestBase {
-
- public RampartEngineTest(String name) {
- super(name);
- }
-
+ /**
+ * Tests that Rampart complains about missing security header in request.
+ *
+ * @throws Exception
+ */
+ @Test(expected=RampartException.class)
public void testEmptySOAPMessage() throws Exception {
-
- try {
- MessageContext ctx = getMsgCtx();
-
- String policyXml = "test-resources/policy/rampart-asymm-binding-6-3des-r15.xml";
- Policy policy = this.loadPolicy(policyXml);
-
- ctx.setProperty(RampartMessageData.KEY_RAMPART_POLICY, policy);
-
- RampartEngine engine = new RampartEngine();
- engine.process(ctx);
- }
- catch (RampartException e) {
- assertEquals("Expected rampart to complain about missing security header",
- "Missing wsse:Security header in request", e.getMessage());
- }
- }
-
- public void testValidSOAPMessage() throws Exception {
-
MessageContext ctx = getMsgCtx();
String policyXml = "test-resources/policy/rampart-asymm-binding-6-3des-r15.xml";
- Policy policy = loadPolicy(policyXml);
+ Policy policy = this.loadPolicy(policyXml);
ctx.setProperty(RampartMessageData.KEY_RAMPART_POLICY, policy);
- MessageBuilder builder = new MessageBuilder();
- builder.build(ctx);
-
- // Building the SOAP envelope from the OMElement
- buildSOAPEnvelope(ctx);
-
RampartEngine engine = new RampartEngine();
- List<WSSecurityEngineResult> results = engine.process(ctx);
+ engine.process(ctx);
+ }
- /*
- The principle purpose of the test case is to verify that the above processes
- without throwing an exception. However, perform a minimal amount of validation on the
- results.
- */
- assertNotNull("RampartEngine returned null result", results);
- //verify cert was stored
- X509Certificate usedCert = null;
- for (WSSecurityEngineResult result : results) {
- Integer action = (Integer) result.get(WSSecurityEngineResult.TAG_ACTION);
- if (action == WSConstants.SIGN) {
- //the result is for the signature, which contains the used certificate
- usedCert = (X509Certificate) result.get(WSSecurityEngineResult.TAG_X509_CERTIFICATE);
- break;
- }
- }
- assertNotNull("Result of processing did not include a certificate", usedCert);
+ @Test
+ public void testValidSOAPMessage() throws Exception {
+ runRampartEngine(getMsgCtx(), "test-resources/policy/rampart-asymm-binding-6-3des-r15.xml");
}
+ @Test
public void testValidSOAP12Message() throws Exception {
+ runRampartEngine(getMsgCtx12(), "test-resources/policy/rampart-asymm-binding-6-3des-r15.xml");
+ }
- MessageContext ctx = getMsgCtx12();
-
- String policyXml = "test-resources/policy/rampart-asymm-binding-6-3des-r15.xml";
+ private void runRampartEngine(MessageContext ctx, String policyXml) throws Exception {
Policy policy = loadPolicy(policyXml);
ctx.setProperty(RampartMessageData.KEY_RAMPART_POLICY, policy);
@@ -130,7 +97,7 @@ public class RampartEngineTest extends M
SOAPBuilder soapBuilder = new SOAPBuilder();
SOAPEnvelope env = ctx.getEnvelope();
ByteArrayInputStream inStream = new ByteArrayInputStream(env.toString().getBytes());
- env = (SOAPEnvelope) soapBuilder.processDocument(inStream, getContentTypeForEnvelope(env), ctx);
+ env = (SOAPEnvelope) soapBuilder.processDocument(inStream, env.getVersion().getMediaType().toString(), ctx);
ctx.setEnvelope(env);
}
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/SymmetricBindingBuilderTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/SymmetricBindingBuilderTest.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/SymmetricBindingBuilderTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/SymmetricBindingBuilderTest.java Tue Jan 31 00:17:19 2017
@@ -17,7 +17,6 @@
package org.apache.rampart;
import java.util.ArrayList;
-import java.util.Vector;
import javax.xml.namespace.QName;
@@ -40,7 +39,7 @@ public class SymmetricBindingBuilderTest
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.ENC_NS, WSConstants.ENC_KEY_LN));
@@ -89,7 +88,7 @@ public class SymmetricBindingBuilderTest
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.ENC_NS, WSConstants.ENC_KEY_LN));
@@ -113,7 +112,7 @@ public class SymmetricBindingBuilderTest
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.ENC_NS, WSConstants.ENC_KEY_LN));
@@ -137,7 +136,7 @@ public class SymmetricBindingBuilderTest
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.ENC_NS, WSConstants.ENC_KEY_LN));
@@ -159,7 +158,7 @@ public class SymmetricBindingBuilderTest
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- ArrayList list = new ArrayList();
+ ArrayList<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.ENC_NS, WSConstants.ENC_KEY_LN));
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/TransportBindingBuilderTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/TransportBindingBuilderTest.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/TransportBindingBuilderTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/rampart/TransportBindingBuilderTest.java Tue Jan 31 00:17:19 2017
@@ -38,7 +38,7 @@ public class TransportBindingBuilderTest
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- List list = new ArrayList();
+ List<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.WSSE_NS, WSConstants.USERNAME_TOKEN_LN));
list.add(new QName(WSConstants.WSSE_NS, WSConstants.BINARY_TOKEN_LN));
@@ -57,7 +57,7 @@ public class TransportBindingBuilderTest
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- List list = new ArrayList();
+ List<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.WSSE_NS, WSConstants.USERNAME_TOKEN_LN));
list.add(new QName(WSConstants.SIG_NS, WSConstants.SIG_LN));
@@ -75,7 +75,7 @@ public class TransportBindingBuilderTest
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- List list = new ArrayList();
+ List<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
list.add(new QName(WSConstants.WSSE_NS, WSConstants.USERNAME_TOKEN_LN));
list.add(new QName(WSConstants.ENC_NS, WSConstants.ENC_KEY_LN));
@@ -97,7 +97,7 @@ public class TransportBindingBuilderTest
MessageBuilder builder = new MessageBuilder();
builder.build(ctx);
- List list = new ArrayList();
+ List<QName> list = new ArrayList<QName>();
list.add(new QName(WSConstants.WSU_NS, WSConstants.TIMESTAMP_TOKEN_LN));
this.verifySecHeader(list.iterator(), ctx.getEnvelope());
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/ws/secpolicy/model/SecpolicyModelTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/ws/secpolicy/model/SecpolicyModelTest.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/ws/secpolicy/model/SecpolicyModelTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/src/test/java/org/apache/ws/secpolicy/model/SecpolicyModelTest.java Tue Jan 31 00:17:19 2017
@@ -35,12 +35,12 @@ public class SecpolicyModelTest extends
public void testSymmBinding() throws Exception {
Policy p = this.getPolicy("test-resources/policy-symm-binding.xml");
- List assertions = (List)p.getAlternatives().next();
+ List<Assertion> assertions = (List<Assertion>)p.getAlternatives().next();
boolean symmBindingFound = false;
- for (Iterator iter = assertions.iterator(); iter.hasNext();) {
- Assertion assertion = (Assertion) iter.next();
+ for (Iterator<Assertion> iter = assertions.iterator(); iter.hasNext();) {
+ Assertion assertion = iter.next();
if(assertion instanceof SymmetricBinding) {
symmBindingFound = true;
SymmetricBinding binding = (SymmetricBinding)assertion;
@@ -67,11 +67,22 @@ public class SecpolicyModelTest extends
public void testAsymmBinding() throws Exception {
this.getPolicy("test-resources/policy-asymm-binding.xml");
}
-
+
public void testTransportBinding() throws Exception {
this.getPolicy("test-resources/policy-transport-binding.xml");
}
+ public void testSymmBindingWithBothProtectionTokenAndEncryptionToken() throws Exception {
+ boolean exceptionThrown = false;
+ try {
+ this.getPolicy("test-resources/policy-symm-binding-fault1.xml");
+ } catch (IllegalArgumentException e) {
+ exceptionThrown = true;
+ }
+ assertTrue("Policy cannot contain both ProtectionToken and EncryptionToken",
+ exceptionThrown);
+ }
+
private Policy getPolicy(String filePath) throws Exception {
OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(new FileInputStream(filePath));
OMElement elem = builder.getDocumentElement();
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/test-resources/axis2.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/test-resources/axis2.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/test-resources/axis2.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-tests/test-resources/axis2.xml Tue Jan 31 00:17:19 2017
@@ -20,7 +20,7 @@
<parameter name="passwordCallbackClass" locked="false">
org.apache.axis2.security.PWCallback</parameter>
- <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <transportSender name="http" class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender">
<parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
</transportSender>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust-mar/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust-mar/pom.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust-mar/pom.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust-mar/pom.xml Tue Jan 31 00:17:19 2017
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-project</artifactId>
- <version>1.7.0-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -35,30 +35,9 @@
<packaging>mar</packaging>
<name>Rampart - Trust-Mar</name>
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/axis/axis2/java/rampart/trunk</connection>
- <developerConnection>
- scm:svn:https://svn.apache.org/repos/asf/axis/axis2/java/rampart/trunk</developerConnection>
- <url>http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk</url>
- </scm>
-
<build>
- <sourceDirectory>src/main/java</sourceDirectory>
- <resources>
- <resource>
- <directory>src/main/java</directory>
- </resource>
- </resources>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-mar-maven-plugin</artifactId>
<extensions>true</extensions>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/pom.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/pom.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/pom.xml Tue Jan 31 00:17:19 2017
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-project</artifactId>
- <version>1.7.0-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -35,31 +35,8 @@
<name>Rampart - Trust</name>
<build>
- <sourceDirectory>src/main/java</sourceDirectory>
- <resources>
- <resource>
- <directory>src/main/java</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>${project.basedir}/src/test/resources</directory>
- </testResource>
- </testResources>
-
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
<artifactId>maven-surefire-plugin</artifactId>
<!--configuration>
<includes>
@@ -82,6 +59,28 @@
<scope>runtime</scope>
</dependency>
<dependency>
+ <groupId>org.apache.ws.security</groupId>
+ <artifactId>wss4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk15on</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
@@ -92,19 +91,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>2.0-beta-5</version>
- <configuration>
- <templateDirectory>${basedir}</templateDirectory>
- <menu ref="parent" />
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
</project>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/STSMessageReceiver.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/STSMessageReceiver.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/STSMessageReceiver.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/STSMessageReceiver.java Tue Jan 31 00:17:19 2017
@@ -39,7 +39,7 @@ public class STSMessageReceiver extends
.getParameter(TokenRequestDispatcherConfig.CONFIG_PARAM_KEY);
Parameter paramFile = inMessage
.getParameter(TokenRequestDispatcherConfig.CONFIG_FILE_KEY);
- TokenRequestDispatcher dispatcher = null;
+ TokenRequestDispatcher dispatcher;
if (param != null) {
dispatcher = new TokenRequestDispatcher(param
.getParameterElement().getFirstChildWithName(
@@ -53,12 +53,8 @@ public class STSMessageReceiver extends
.getProperty(TokenRequestDispatcherConfig.CONFIG_PARAM_KEY));
}
- if(dispatcher != null) {
- SOAPEnvelope responseEnv = dispatcher.handle(inMessage, outMessage);
- outMessage.setEnvelope(responseEnv);
- } else {
- throw new TrustException("missingDispatcherConfiguration");
- }
+ SOAPEnvelope responseEnv = dispatcher.handle(inMessage, outMessage);
+ outMessage.setEnvelope(responseEnv);
} catch (TrustException e) {
e.printStackTrace();
//Log the exception
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/SimpleTokenStore.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/SimpleTokenStore.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/SimpleTokenStore.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/SimpleTokenStore.java Tue Jan 31 00:17:19 2017
@@ -23,7 +23,12 @@ import org.apache.ws.security.message.to
import javax.xml.namespace.QName;
import java.io.Serializable;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -86,17 +91,13 @@ public class SimpleTokenStore implements
}
public String[] getTokenIdentifiers() throws TrustException {
- List identifiers = new ArrayList();
-
readLock.lock();
try {
- for (Iterator iterator = tokens.keySet().iterator(); iterator.hasNext();) {
- identifiers.add(iterator.next());
- }
+ Set identifiers = tokens.keySet();
+ return (String[]) identifiers.toArray(new String[identifiers.size()]);
} finally {
readLock.unlock();
}
- return (String[]) identifiers.toArray(new String[identifiers.size()]);
}
public Token[] getValidTokens() throws TrustException {
@@ -116,8 +117,7 @@ public class SimpleTokenStore implements
return getTokens(Token.EXPIRED);
}
- private Token[] getTokens(int[] states) throws TrustException {
- processTokenExpiry();
+ private Token[] getTokens(int... states) throws TrustException {
List tokens = new ArrayList();
readLock.lock();
@@ -125,6 +125,7 @@ public class SimpleTokenStore implements
try {
for (Iterator iterator = this.tokens.values().iterator(); iterator.hasNext();) {
Token token = (Token) iterator.next();
+ processTokenExpiry(token);
for (int i = 0; i < states.length; i++) {
if (token.getState() == states[i]) {
tokens.add(token);
@@ -138,28 +139,7 @@ public class SimpleTokenStore implements
return (Token[]) tokens.toArray(new Token[tokens.size()]);
}
- private Token[] getTokens(int state) throws TrustException {
- processTokenExpiry();
- List tokens = new ArrayList();
-
- readLock.lock();
-
- try {
- for (Iterator iterator = this.tokens.values().iterator(); iterator.hasNext();) {
- Token token = (Token) iterator.next();
- if (token.getState() == state) {
- tokens.add(token);
- }
- }
- } finally {
- readLock.unlock();
- }
- return (Token[]) tokens.toArray(new Token[tokens.size()]);
- }
-
public Token getToken(String id) throws TrustException {
- processTokenExpiry();
-
readLock.lock();
Token token;
@@ -172,6 +152,7 @@ public class SimpleTokenStore implements
//Try to find the token using attached refs & unattached refs
for (Iterator iterator = this.tokens.values().iterator(); iterator.hasNext();) {
Token tempToken = (Token) iterator.next();
+ processTokenExpiry(tempToken);
OMElement elem = tempToken.getAttachedReference();
if(elem != null && id.equals(this.getIdFromSTR(elem))) {
token = tempToken;
@@ -182,7 +163,8 @@ public class SimpleTokenStore implements
}
}
-
+ } else {
+ processTokenExpiry(token);
}
} finally {
@@ -202,20 +184,10 @@ public class SimpleTokenStore implements
}
}
- protected void processTokenExpiry() throws TrustException {
-
- readLock.lock();
-
- try {
- for (Iterator iterator = tokens.values().iterator(); iterator.hasNext();) {
- Token token = (Token) iterator.next();
- if (token.getExpires() != null &&
- token.getExpires().getTime() < System.currentTimeMillis()) {
- token.setState(Token.EXPIRED);
- }
- }
- } finally {
- readLock.unlock();
+ protected void processTokenExpiry(Token token) throws TrustException {
+ if (token.getExpires() != null &&
+ token.getExpires().getTime() < System.currentTimeMillis()) {
+ token.setState(Token.EXPIRED);
}
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/client/STSClient.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/client/STSClient.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/client/STSClient.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/client/STSClient.java Tue Jan 31 00:17:19 2017
@@ -20,7 +20,7 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMNode;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axiom.util.base64.Base64Utils;
import org.apache.axis2.AxisFault;
@@ -477,7 +477,7 @@ public class STSClient {
secret = Base64Utils.decode(b64Secret);
} else if (child.getQName().equals(new QName(ns, WSConstants.ENC_KEY_LN))) {
- Element domChild = (Element) new StAXOMBuilder(
+ Element domChild = (Element)OMXMLBuilderFactory.createStAXOMBuilder(
OMAbstractFactory.getMetaFactory(
OMAbstractFactory.FEATURE_DOM).getOMFactory(),
child.getXMLStreamReader()).getDocumentElement();
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SAML2TokenIssuer.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SAML2TokenIssuer.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SAML2TokenIssuer.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SAML2TokenIssuer.java Tue Jan 31 00:17:19 2017
@@ -136,7 +136,7 @@ public class SAML2TokenIssuer implements
* <wst:TokenType>...</wst:TokenType>
* <wst:RequestedSecurityToken>...</wst:RequestedSecurityToken>
* ...
- * <wsp:AppliesTo xmlns:wsp="...”>...</wsp:AppliesTo>
+ * <wsp:AppliesTo xmlns:wsp="...">...</wsp:AppliesTo>
* <wst:RequestedAttachedReference>
* ...
* </wst:RequestedAttachedReference>
@@ -359,7 +359,7 @@ public class SAML2TokenIssuer implements
* ...
* </saml2:NameID>
* <saml2:SubjectConfirmation
- * Method=”urn:oasis:names:tc:SAML:2.0:cm:holder-of-key”>
+ * Method="urn:oasis:names:tc:SAML:2.0:cm:holder-of-key">
* <saml2:SubjectConfirmationData
* xsi:type="saml2:KeyInfoConfirmationDataType">
* <ds:KeyInfo>
@@ -441,8 +441,8 @@ public class SAML2TokenIssuer implements
* <saml:Subject>
* <saml:NameIdentifier
* NameQualifier="www.example.com"
- * Format=“urn:oasis:names:tc:SAML:1.1:nameid-
- * format:X509SubjectName”>
+ * Format="urn:oasis:names:tc:SAML:1.1:nameid-
+ * format:X509SubjectName">
* uid=joe,ou=people,ou=saml-demo,o=baltimore.com
* </saml:NameIdentifier>
* <saml:SubjectConfirmation>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SCTIssuerConfig.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SCTIssuerConfig.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SCTIssuerConfig.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SCTIssuerConfig.java Tue Jan 31 00:17:19 2017
@@ -17,7 +17,8 @@
package org.apache.rahas.impl;
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.rahas.TrustException;
import javax.xml.namespace.QName;
@@ -68,10 +69,10 @@ public class SCTIssuerConfig extends Abs
public static SCTIssuerConfig load(String configFilePath)
throws TrustException {
FileInputStream fis;
- StAXOMBuilder builder;
+ OMXMLParserWrapper builder;
try {
fis = new FileInputStream(configFilePath);
- builder = new StAXOMBuilder(fis);
+ builder = OMXMLBuilderFactory.createOMBuilder(fis);
} catch (Exception e) {
throw new TrustException("errorLoadingConfigFile",
new String[] { configFilePath });
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/TokenCancelerConfig.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/TokenCancelerConfig.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/TokenCancelerConfig.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/TokenCancelerConfig.java Tue Jan 31 00:17:19 2017
@@ -16,7 +16,8 @@
package org.apache.rahas.impl;
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.rahas.TrustException;
import javax.xml.namespace.QName;
@@ -68,10 +69,10 @@ public class TokenCancelerConfig {
public static TokenCancelerConfig load(String configFilePath)
throws TrustException {
FileInputStream fis;
- StAXOMBuilder builder;
+ OMXMLParserWrapper builder;
try {
fis = new FileInputStream(configFilePath);
- builder = new StAXOMBuilder(fis);
+ builder = OMXMLBuilderFactory.createOMBuilder(fis);
} catch (Exception e) {
throw new TrustException("errorLoadingConfigFile", new String[] { configFilePath });
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/util/SAMLUtils.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/util/SAMLUtils.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/util/SAMLUtils.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-trust/src/main/java/org/apache/rahas/impl/util/SAMLUtils.java Tue Jan 31 00:17:19 2017
@@ -1,5 +1,6 @@
package org.apache.rahas.impl.util;
+import org.apache.axiom.util.UIDGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.rahas.RahasConstants;
@@ -25,8 +26,6 @@ import org.opensaml.xml.schema.impl.XSSt
import org.opensaml.xml.security.SecurityHelper;
import org.opensaml.xml.security.credential.Credential;
import org.opensaml.xml.signature.*;
-import org.opensaml.xml.signature.KeyInfo;
-import org.opensaml.xml.signature.X509Data;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -386,7 +385,7 @@ public class SAMLUtils {
* This method creates the final SAML assertion. The final SAML assertion would looks like as follows,
* <saml:Assertion AssertionID="_a75adf55-01d7-40cc-929f-dbd8372ebdfc"
* IssueInstant="2003-04-17T00:46:02Z"
- * Issuer=”www.opensaml.org”
+ * Issuer="www.opensaml.org"
* MajorVersion="1"
* MinorVersion="1"
* xmlns="urn:oasis:names:tc:SAML:1.0:assertion">
@@ -436,7 +435,8 @@ public class SAMLUtils {
assertion.setIssuer(issuerName);
assertion.setConditions(SAMLUtils.createConditions(notBefore, notOnOrAfter));
assertion.getStatements().addAll(statements);
-
+ assertion.setID(UIDGenerator.generateUID());
+ assertion.setIssueInstant(new DateTime());
return assertion;
}
@@ -565,7 +565,7 @@ public class SAMLUtils {
// Encoding type set to http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0
// #Base64Binary
keyIdentifier.setEncodingType(KeyIdentifier.ENCODING_TYPE_BASE64_BINARY);
- keyIdentifier.setValueType(WSSecurityConstants.THUMB_PRINT_SHA1);
+ keyIdentifier.setValueType(WSSecurityConstants.WS_SECURITY11_NS+"#ThumbprintSHA1");
keyIdentifier.setValue(getThumbprintSha1(certificate));
securityTokenReference.getUnknownXMLObjects().add(keyIdentifier);