Author: owulff
Date: Thu Jun 14 20:56:15 2012
New Revision: 1350400
URL: http://svn.apache.org/viewvc?rev=1350400&view=rev
Log:
ApplicationServiceURL config added
Modified:
cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/FederationProcessorImpl.java
cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java
cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
cxf/fediz/trunk/plugins/core/src/main/resources/schemas/FedizConfig.xsd
cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/FederationProcessorTest.java
cxf/fediz/trunk/plugins/core/src/test/resources/fediz_meta_test_config.xml
Modified:
cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/FederationProcessorImpl.java
URL:
http://svn.apache.org/viewvc/cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/FederationProcessorImpl.java?rev=1350400&r1=1350399&r2=1350400&view=diff
==============================================================================
---
cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/FederationProcessorImpl.java
(original)
+++
cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/FederationProcessorImpl.java
Thu Jun 14 20:56:15 2012
@@ -358,7 +358,7 @@ public class FederationProcessorImpl imp
.append(URLEncoder.encode(homeRealm, "UTF-8"));
}
- // add wct
+ // add current time parameter wct
Date creationTime = new Date();
XmlSchemaDateFormat fmt = new XmlSchemaDateFormat();
String wct = fmt.format(creationTime);
Modified:
cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java
URL:
http://svn.apache.org/viewvc/cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java?rev=1350400&r1=1350399&r2=1350400&view=diff
==============================================================================
---
cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java
(original)
+++
cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java
Thu Jun 14 20:56:15 2012
@@ -111,6 +111,14 @@ public class FederationProtocol extends
public void setRoleURI(String value) {
getFederationProtocol().setRoleURI(value);
}
+
+ public String getApplicationServiceURL() {
+ return getFederationProtocol().getApplicationServiceURL();
+ }
+
+ public void setApplicationServiceURL(String value) {
+ getFederationProtocol().setApplicationServiceURL(value);
+ }
public Object getAuthenticationType() {
if (this.authenticationType != null) {
Modified:
cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
URL:
http://svn.apache.org/viewvc/cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java?rev=1350400&r1=1350399&r2=1350400&view=diff
==============================================================================
---
cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
(original)
+++
cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
Thu Jun 14 20:56:15 2012
@@ -98,13 +98,19 @@ public class MetadataWriter {
writer.writeAttribute("ID", referenceID);
String audience = "_someID";
+ String serviceURL = null;
if (protocol instanceof FederationProtocol) {
+ serviceURL =
((FederationProtocol)protocol).getApplicationServiceURL();
List<String> audienceList = config.getAudienceUris();
if (audienceList != null && audienceList.size() > 0 &&
!"".equals(audienceList.get(0))) {
audience = audienceList.get(0);
}
}
- writer.writeAttribute("entityID", audience);
+ if (serviceURL == null) {
+ serviceURL = audience;
+ }
+
+ writer.writeAttribute("entityID", serviceURL);
writer.writeNamespace("fed", WS_FEDERATION_NS);
writer.writeNamespace("wsa", WS_ADDRESSING_NS);
@@ -119,7 +125,7 @@ public class MetadataWriter {
writer.writeStartElement("wsa", "EndpointReference",
WS_ADDRESSING_NS);
writer.writeStartElement("wsa", "Address", WS_ADDRESSING_NS);
- writer.writeCharacters(audience);
+ writer.writeCharacters(serviceURL);
writer.writeEndElement(); // Address
writer.writeEndElement(); // EndpointReference
Modified:
cxf/fediz/trunk/plugins/core/src/main/resources/schemas/FedizConfig.xsd
URL:
http://svn.apache.org/viewvc/cxf/fediz/trunk/plugins/core/src/main/resources/schemas/FedizConfig.xsd?rev=1350400&r1=1350399&r2=1350400&view=diff
==============================================================================
--- cxf/fediz/trunk/plugins/core/src/main/resources/schemas/FedizConfig.xsd
(original)
+++ cxf/fediz/trunk/plugins/core/src/main/resources/schemas/FedizConfig.xsd Thu
Jun 14 20:56:15 2012
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
<xs:element name="FedizConfig">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
@@ -27,10 +28,6 @@
</xs:complexType>
</xs:element>
- <!-- <xs:element name="trustedIssuerItem" type="TrustManagersType" />
<xs:element
- name="trustedIssuers"> <xs:complexType> <xs:sequence
minOccurs="1" maxOccurs="unbounded">
- <xs:element ref="trustedIssuerItem" /> </xs:sequence>
</xs:complexType> </xs:element> -->
-
<xs:element name="trustedIssuers">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
@@ -54,8 +51,6 @@
</xs:complexType>
</xs:element>
-
- <!-- <xs:element name="audienceUris" type="xs:anyURI"/> -->
<xs:element name="audienceUris">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
@@ -75,14 +70,12 @@
</xs:restriction>
</xs:simpleType>
-
-
<xs:element name="maximumClockSkew" type="xs:integer" default="60"/>
<xs:element name="tokenReplayCache" type="xs:string" />
- <!-- keystore type -->
<xs:element name="serviceCertificate" type="KeyManagersType" />
+
<xs:element name="signingKey" type="KeyManagersType" />
<xs:element name="protocol" type="protocolType" />
@@ -102,12 +95,9 @@
<xs:element ref="request" />
<xs:element ref="claimTypesRequested" />
<xs:element ref="tokenValidators" />
+ <xs:element ref="applicationServiceURL"
/>
</xs:sequence>
- <!-- <xs:attribute name="roleDelimiter"
type="xs:string"/> -->
- <!--<xs:attribute name="roleURI" use="required"
type="xs:string"/> -->
<xs:attribute name="version" use="required"
type="xs:string" />
- <!--<xs:attribute name="realm" use="required"
type="xs:string"/> -->
- <!--<xs:attribute name="freshness"
use="required" type="xs:string"/> -->
</xs:extension>
</xs:complexContent>
</xs:complexType>
@@ -115,6 +105,7 @@
<xs:element name="roleDelimiter" type="xs:string" />
<xs:element name="roleURI" type="xs:string" />
<xs:element name="realm" type="xs:string" />
+ <xs:element name="applicationServiceURL" type="xs:string" />
<xs:element name="freshness" type="xs:string" />
Modified:
cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/FederationProcessorTest.java
URL:
http://svn.apache.org/viewvc/cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/FederationProcessorTest.java?rev=1350400&r1=1350399&r2=1350400&view=diff
==============================================================================
---
cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/FederationProcessorTest.java
(original)
+++
cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/FederationProcessorTest.java
Thu Jun 14 20:56:15 2012
@@ -55,6 +55,7 @@ import org.apache.ws.security.util.DOM2W
import org.joda.time.DateTime;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.opensaml.common.SAMLVersion;
@@ -182,7 +183,13 @@ public class FederationProcessorTest {
}
}
-
+ @Ignore
+ @org.junit.Test
+ public void validateTokenAndCreateMetadata() throws Exception {
+ validateSAML2Token();
+ FederationMetaDataTest other = new FederationMetaDataTest();
+ other.validateMetaDataWithAlias();
+ }
/**
* Validate SAML 2 token which includes the role attribute with 2 values
Modified:
cxf/fediz/trunk/plugins/core/src/test/resources/fediz_meta_test_config.xml
URL:
http://svn.apache.org/viewvc/cxf/fediz/trunk/plugins/core/src/test/resources/fediz_meta_test_config.xml?rev=1350400&r1=1350399&r2=1350400&view=diff
==============================================================================
--- cxf/fediz/trunk/plugins/core/src/test/resources/fediz_meta_test_config.xml
(original)
+++ cxf/fediz/trunk/plugins/core/src/test/resources/fediz_meta_test_config.xml
Thu Jun 14 20:56:15 2012
@@ -21,6 +21,7 @@
<protocol xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="federationProtocolType" version="1.2">
<realm>http://Server:Port/value from protocol.realm
config property </realm>
+ <applicationServiceURL>http://Server:port/value from
protocol.applicationServiceURL config property</applicationServiceURL>
<issuer>http://Server:Port/value from protocol.issuer
config property</issuer>
<roleDelimiter>;</roleDelimiter>
<roleURI>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role</roleURI>