[jboss-cvs] Picketlink SVN: r315 - in federation/trunk: picketlink-seam/src/main/java/org/picketlink/identity/seam/federation and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jun 18 14:06:35 EDT 2010


Author: marcelkolsteren
Date: 2010-06-18 14:06:34 -0400 (Fri, 18 Jun 2010)
New Revision: 315

Added:
   federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/OpenIdXrdsProvider.java
   federation/trunk/picketlink-seam/src/main/resources/schema/xrds/
   federation/trunk/picketlink-seam/src/main/resources/schema/xrds/xrd.xsd
   federation/trunk/picketlink-seam/src/main/resources/schema/xrds/xrds.xsd
Modified:
   federation/trunk/picketlink-seam/pom.xml
   federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticationFilter.java
   federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticationService.java
   federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/OpenIdSingleLoginSender.java
   federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/Configuration.java
   federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/OpenIdConfiguration.java
   federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/SamlConfiguration.java
   federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/ServiceProvider.java
   federation/trunk/picketlink-webapps/seam-sp/src/main/webapp/PrincipalInfoFragment.xhtml
   federation/trunk/picketlink-webapps/seam-sp/src/main/webapp/PublicPage.xhtml
Log:
PLFED-16: "Seam module: serve XRDS file so that OpenID providers can validate the relying party"

Modified: federation/trunk/picketlink-seam/pom.xml
===================================================================
--- federation/trunk/picketlink-seam/pom.xml	2010-06-16 15:03:56 UTC (rev 314)
+++ federation/trunk/picketlink-seam/pom.xml	2010-06-18 18:06:34 UTC (rev 315)
@@ -51,17 +51,32 @@
             <version>1.3</version>
             <executions>
                <execution>
+                  <id>jaxb-xrds</id>
+                  <configuration>
+                     <schemaDirectory>${basedir}/src/main/resources/schema/xrds</schemaDirectory>
+                     <packageName>org.picketlink.identity.seam.federation.jaxb.xrds</packageName>
+                     <outputDirectory>${basedir}/src/main/generated-source</outputDirectory>
+                     <clearOutputDir>true</clearOutputDir>
+                     <staleFile>${project.build.directory}/generated-sources/jaxb/.staleFlag_xrds</staleFile>
+                  </configuration>
                   <goals>
                      <goal>xjc</goal>
                   </goals>
                </execution>
+               <execution>
+                  <id>jaxb-config</id>
+                  <configuration>
+                     <schemaDirectory>${basedir}/src/main/resources/schema/config</schemaDirectory>
+                     <packageName>org.picketlink.identity.seam.federation.jaxb.config</packageName>
+                     <outputDirectory>${basedir}/src/main/generated-source</outputDirectory>
+                     <clearOutputDir>false</clearOutputDir>
+                     <staleFile>${project.build.directory}/generated-sources/jaxb/.staleFlag_config</staleFile>
+                  </configuration>
+                  <goals>
+                     <goal>xjc</goal>
+                  </goals>
+               </execution>
             </executions>
-            <configuration>
-               <schemaDirectory>${basedir}/src/main/resources/schema/config</schemaDirectory>
-               <schemaFiles>external-authentication-config.xsd</schemaFiles>
-               <packageName>org.picketlink.identity.seam.federation.config.jaxb</packageName>
-               <outputDirectory>${basedir}/src/main/generated-source</outputDirectory>
-            </configuration>
          </plugin>
       </plugins>
    </build>
@@ -75,6 +90,12 @@
          <groupId>org.picketlink</groupId>
          <artifactId>picketlink-fed-api</artifactId>
          <version>${project.version}</version>
+         <exclusions>
+            <exclusion>
+               <groupId>org.jboss.security</groupId>
+               <artifactId>jboss-security-spi</artifactId>
+            </exclusion>
+         </exclusions>
       </dependency>
       <dependency>
          <groupId>org.picketlink</groupId>

Modified: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticationFilter.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticationFilter.java	2010-06-16 15:03:56 UTC (rev 314)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticationFilter.java	2010-06-18 18:06:34 UTC (rev 315)
@@ -212,6 +212,15 @@
             httpResponse.setContentType("application/xml");
             httpResponse.flushBuffer();
             break;
+         case OPEN_ID_XRDS_SERVICE :
+            OpenIdXrdsProvider openIdXrdsProvider = (OpenIdXrdsProvider) Component
+                  .getInstance(OpenIdXrdsProvider.class);
+
+            openIdXrdsProvider.writeMetaData(httpResponse.getOutputStream());
+            httpResponse.setCharacterEncoding("UTF-8");
+            httpResponse.setContentType("application/xrds+xml");
+            httpResponse.flushBuffer();
+            break;
          default :
             throw new RuntimeException("Unsupported service " + service);
       }

Modified: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticationService.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticationService.java	2010-06-16 15:03:56 UTC (rev 314)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/ExternalAuthenticationService.java	2010-06-18 18:06:34 UTC (rev 315)
@@ -37,8 +37,10 @@
 
    SAML_META_DATA_SERVICE("MetaDataService"),
 
-   OPEN_ID_SERVICE("OpenIdService");
+   OPEN_ID_SERVICE("OpenIdService"),
 
+   OPEN_ID_XRDS_SERVICE("OpenIdXrdsService");
+
    private String name;
 
    private ExternalAuthenticationService(String name)

Modified: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/OpenIdSingleLoginSender.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/OpenIdSingleLoginSender.java	2010-06-16 15:03:56 UTC (rev 314)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/OpenIdSingleLoginSender.java	2010-06-18 18:06:34 UTC (rev 315)
@@ -35,8 +35,8 @@
 import org.openid4java.discovery.DiscoveryInformation;
 import org.openid4java.message.AuthRequest;
 import org.openid4java.message.ax.FetchRequest;
-import org.picketlink.identity.seam.federation.config.jaxb.OpenIdAttributeType;
 import org.picketlink.identity.seam.federation.configuration.ServiceProvider;
+import org.picketlink.identity.seam.federation.jaxb.config.OpenIdAttributeType;
 
 /**
 * @author Marcel Kolsteren
@@ -69,7 +69,8 @@
          openIdRequest.setReturnUrl(returnUrl);
 
          String openIdServiceUrl = serviceProvider.getServiceURL(ExternalAuthenticationService.OPEN_ID_SERVICE);
-         AuthRequest authReq = openIdConsumerManager.authenticate(discovered, openIdServiceUrl);
+         String realm = serviceProvider.getOpenIdRealm();
+         AuthRequest authReq = openIdConsumerManager.authenticate(discovered, openIdServiceUrl, realm);
 
          // Request attributes
          List<OpenIdAttributeType> attributes = serviceProvider.getOpenIdConfiguration().getAttributes();

Added: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/OpenIdXrdsProvider.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/OpenIdXrdsProvider.java	                        (rev 0)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/OpenIdXrdsProvider.java	2010-06-18 18:06:34 UTC (rev 315)
@@ -0,0 +1,87 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.picketlink.identity.seam.federation;
+
+import java.io.OutputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.openid4java.discovery.DiscoveryInformation;
+import org.picketlink.identity.seam.federation.configuration.ServiceProvider;
+import org.picketlink.identity.seam.federation.jaxb.xrds.ObjectFactory;
+import org.picketlink.identity.seam.federation.jaxb.xrds.Service;
+import org.picketlink.identity.seam.federation.jaxb.xrds.Type;
+import org.picketlink.identity.seam.federation.jaxb.xrds.URIPriorityAppendPattern;
+import org.picketlink.identity.seam.federation.jaxb.xrds.XRD;
+import org.picketlink.identity.seam.federation.jaxb.xrds.XRDS;
+
+/**
+* @author Marcel Kolsteren
+* @since Jan 20, 2010
+*/
+ at Name("org.picketlink.identity.seam.federation.openIdXrdsProvider")
+ at AutoCreate
+public class OpenIdXrdsProvider
+{
+   @In
+   private ServiceProvider serviceProvider;
+
+   public void writeMetaData(OutputStream stream)
+   {
+      try
+      {
+         ObjectFactory objectFactory = new ObjectFactory();
+
+         XRDS xrds = objectFactory.createXRDS();
+
+         XRD xrd = objectFactory.createXRD();
+
+         Type type = objectFactory.createType();
+         type.setValue(DiscoveryInformation.OPENID2_RP);
+         URIPriorityAppendPattern uri = objectFactory.createURIPriorityAppendPattern();
+         uri.setValue(serviceProvider.getServiceURL(ExternalAuthenticationService.OPEN_ID_SERVICE));
+
+         Service service = objectFactory.createService();
+         service.getType().add(type);
+         service.getURI().add(uri);
+
+         xrd.getService().add(service);
+
+         xrds.getOtherelement().add(xrd);
+
+         JAXBContext jaxbContext = JAXBContext.newInstance("org.picketlink.identity.seam.federation.jaxb.xrds");
+         Marshaller marshaller = jaxbContext.createMarshaller();
+         marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+         marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+         marshaller.marshal(xrds, stream);
+      }
+      catch (JAXBException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+}


Property changes on: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/OpenIdXrdsProvider.java
___________________________________________________________________
Name: svn
   + eol-style=native
Name: svn:keywords
   + Revision Author Date

Modified: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/Configuration.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/Configuration.java	2010-06-16 15:03:56 UTC (rev 314)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/Configuration.java	2010-06-18 18:06:34 UTC (rev 315)
@@ -45,8 +45,8 @@
 import org.jboss.seam.annotations.Scope;
 import org.jboss.seam.annotations.Startup;
 import org.jboss.seam.web.ServletContexts;
-import org.picketlink.identity.seam.federation.config.jaxb.ExternalAuthenticationConfigType;
-import org.picketlink.identity.seam.federation.config.jaxb.ServiceProviderType;
+import org.picketlink.identity.seam.federation.jaxb.config.ExternalAuthenticationConfigType;
+import org.picketlink.identity.seam.federation.jaxb.config.ServiceProviderType;
 import org.xml.sax.SAXException;
 
 /**
@@ -91,7 +91,7 @@
       ExternalAuthenticationConfigType externalAuthenticationConfig;
       try
       {
-         JAXBContext jaxbContext = JAXBContext.newInstance("org.picketlink.identity.seam.federation.config.jaxb");
+         JAXBContext jaxbContext = JAXBContext.newInstance("org.picketlink.identity.seam.federation.jaxb.config");
          Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
          URL schemaURL = getClass().getResource("/schema/config/external-authentication-config.xsd");
          Schema schema;

Modified: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/OpenIdConfiguration.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/OpenIdConfiguration.java	2010-06-16 15:03:56 UTC (rev 314)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/OpenIdConfiguration.java	2010-06-18 18:06:34 UTC (rev 315)
@@ -23,8 +23,8 @@
 
 import java.util.List;
 
-import org.picketlink.identity.seam.federation.config.jaxb.OpenIdAttributeType;
-import org.picketlink.identity.seam.federation.config.jaxb.OpenIdConfigType;
+import org.picketlink.identity.seam.federation.jaxb.config.OpenIdAttributeType;
+import org.picketlink.identity.seam.federation.jaxb.config.OpenIdConfigType;
 
 /**
 * @author Marcel Kolsteren

Modified: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/SamlConfiguration.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/SamlConfiguration.java	2010-06-16 15:03:56 UTC (rev 314)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/SamlConfiguration.java	2010-06-18 18:06:34 UTC (rev 315)
@@ -46,8 +46,8 @@
 import org.picketlink.identity.federation.saml.v2.metadata.EntityDescriptorType;
 import org.picketlink.identity.federation.saml.v2.metadata.IDPSSODescriptorType;
 import org.picketlink.identity.federation.saml.v2.metadata.RoleDescriptorType;
-import org.picketlink.identity.seam.federation.config.jaxb.SamlConfigType;
-import org.picketlink.identity.seam.federation.config.jaxb.SamlIdentityProviderType;
+import org.picketlink.identity.seam.federation.jaxb.config.SamlConfigType;
+import org.picketlink.identity.seam.federation.jaxb.config.SamlIdentityProviderType;
 
 /**
 * @author Marcel Kolsteren

Modified: federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/ServiceProvider.java
===================================================================
--- federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/ServiceProvider.java	2010-06-16 15:03:56 UTC (rev 314)
+++ federation/trunk/picketlink-seam/src/main/java/org/picketlink/identity/seam/federation/configuration/ServiceProvider.java	2010-06-18 18:06:34 UTC (rev 315)
@@ -29,7 +29,7 @@
 import org.jboss.seam.core.Expressions;
 import org.jboss.seam.core.Expressions.MethodExpression;
 import org.picketlink.identity.seam.federation.ExternalAuthenticationService;
-import org.picketlink.identity.seam.federation.config.jaxb.ServiceProviderType;
+import org.picketlink.identity.seam.federation.jaxb.config.ServiceProviderType;
 
 /**
 * @author Marcel Kolsteren
@@ -101,10 +101,26 @@
    public String getServiceURL(ExternalAuthenticationService service)
    {
       String path = configuration.getContextRoot() + "/" + service.getName() + ".seam";
+      return createURL(path);
+   }
 
+   public String getOpenIdRealm()
+   {
+      return createURL("");
+   }
+
+   private String createURL(String path)
+   {
       try
       {
-         return new URL(protocol, hostname, port, path).toExternalForm();
+         if (protocol.equals("http") && port == 80 || protocol.equals("https") && port == 443)
+         {
+            return new URL(protocol, hostname, path).toExternalForm();
+         }
+         else
+         {
+            return new URL(protocol, hostname, port, path).toExternalForm();
+         }
       }
       catch (MalformedURLException e)
       {

Added: federation/trunk/picketlink-seam/src/main/resources/schema/xrds/xrd.xsd
===================================================================
--- federation/trunk/picketlink-seam/src/main/resources/schema/xrds/xrd.xsd	                        (rev 0)
+++ federation/trunk/picketlink-seam/src/main/resources/schema/xrds/xrd.xsd	2010-06-18 18:06:34 UTC (rev 315)
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xrd="xri://$xrd*($v*2.0)" targetNamespace="xri://$xrd*($v*2.0)" elementFormDefault="qualified">
+	<!-- Utility patterns -->
+	<xs:attributeGroup name="otherattribute">
+		<xs:anyAttribute namespace="##other" processContents="lax"/>
+	</xs:attributeGroup>
+	<xs:group name="otherelement">
+		<xs:choice>
+			<xs:any namespace="##other" processContents="lax"/>
+			<xs:any namespace="##local" processContents="lax"/>
+		</xs:choice>
+	</xs:group>
+	<xs:attributeGroup name="priorityAttrGrp">
+		<xs:attribute name="priority" type="xs:nonNegativeInteger" use="optional"/>
+	</xs:attributeGroup>
+	<xs:attributeGroup name="codeAttrGrp">
+		<xs:attribute name="code" type="xs:int" use="required"/>
+	</xs:attributeGroup>
+	<xs:attributeGroup name="verifyAttrGrp">
+		<xs:attribute name="cid" use="optional">
+			<xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="absent"/>
+					<xs:enumeration value="off"/>
+					<xs:enumeration value="verified"/>
+					<xs:enumeration value="failed"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+		<xs:attribute name="ceid" use="optional">
+			<xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="absent"/>
+					<xs:enumeration value="off"/>
+					<xs:enumeration value="verified"/>
+					<xs:enumeration value="failed"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+	</xs:attributeGroup>
+	<xs:attributeGroup name="selectionAttrGrp">
+		<xs:attribute name="match" use="optional" default="default">
+			<xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="default"/>
+					<xs:enumeration value="any"/>
+					<xs:enumeration value="non-null"/>
+					<xs:enumeration value="null"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+		<xs:attribute name="select" type="xs:boolean" use="optional" default="false"/>
+	</xs:attributeGroup>
+	<xs:attributeGroup name="appendAttrGrp">
+		<xs:attribute name="append" use="optional" default="none">
+			<xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="none"/>
+					<xs:enumeration value="local"/>
+					<xs:enumeration value="authority"/>
+					<xs:enumeration value="path"/>
+					<xs:enumeration value="query"/>
+					<xs:enumeration value="qxri"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+	</xs:attributeGroup>
+	<xs:complexType name="URIPattern">
+		<xs:simpleContent>
+			<xs:extension base="xs:anyURI">
+				<xs:attributeGroup ref="xrd:otherattribute"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="URIPriorityPattern">
+		<xs:simpleContent>
+			<xs:extension base="xrd:URIPattern">
+				<xs:attributeGroup ref="xrd:priorityAttrGrp"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="URIPriorityAppendPattern">
+		<xs:simpleContent>
+			<xs:extension base="xrd:URIPriorityPattern">
+				<xs:attributeGroup ref="xrd:appendAttrGrp"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="StringPattern">
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attributeGroup ref="xrd:otherattribute"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="StringSelectionPattern">
+		<xs:simpleContent>
+			<xs:extension base="xrd:StringPattern">
+				<xs:attributeGroup ref="xrd:selectionAttrGrp"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<!-- Patterns for elements -->
+	<xs:element name="XRD">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="xrd:Query" minOccurs="0"/>
+				<xs:element ref="xrd:Status" minOccurs="0"/>
+				<xs:element ref="xrd:ServerStatus" minOccurs="0"/>
+				<xs:element ref="xrd:Expires" minOccurs="0"/>
+				<xs:element ref="xrd:ProviderID" minOccurs="0"/>
+				<xs:choice>
+					<xs:element ref="xrd:Redirect" minOccurs="0" maxOccurs="unbounded"/>
+					<xs:element ref="xrd:Ref" minOccurs="0" maxOccurs="unbounded"/>
+				</xs:choice>
+				<xs:element ref="xrd:LocalID" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="xrd:EquivID" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="xrd:CanonicalID" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="xrd:CanonicalEquivID" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="xrd:Service" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:group ref="xrd:otherelement" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attribute name="idref" type="xs:IDREF" use="optional"/>
+			<xs:attribute name="version" type="xs:string" use="optional" fixed="2.0"/>
+			<xs:attributeGroup ref="xrd:otherattribute"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="Query" type="xrd:StringPattern"/>
+	<xs:element name="Status">
+		<xs:complexType>
+			<xs:simpleContent>
+				<xs:extension base="xrd:StringPattern">
+					<xs:attributeGroup ref="xrd:codeAttrGrp"/>
+					<xs:attributeGroup ref="xrd:verifyAttrGrp"/>
+					<xs:attributeGroup ref="xrd:otherattribute"/>
+				</xs:extension>
+			</xs:simpleContent>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="ServerStatus">
+		<xs:complexType>
+			<xs:simpleContent>
+				<xs:extension base="xrd:StringPattern">
+					<xs:attributeGroup ref="xrd:codeAttrGrp"/>
+					<xs:attributeGroup ref="xrd:otherattribute"/>
+				</xs:extension>
+			</xs:simpleContent>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="Expires">
+		<xs:complexType>
+			<xs:simpleContent>
+				<xs:extension base="xs:dateTime">
+					<xs:attributeGroup ref="xrd:otherattribute"/>
+				</xs:extension>
+			</xs:simpleContent>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="ProviderID" type="xrd:URIPattern"/>
+	<xs:element name="Redirect" type="xrd:URIPriorityAppendPattern"/>
+	<xs:element name="Ref" type="xrd:URIPriorityPattern"/>
+	<xs:element name="LocalID">
+		<xs:complexType>
+			<xs:simpleContent>
+				<xs:extension base="xrd:StringPattern">
+					<xs:attributeGroup ref="xrd:priorityAttrGrp"/>
+				</xs:extension>
+			</xs:simpleContent>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="EquivID" type="xrd:URIPriorityPattern"/>
+	<xs:element name="CanonicalID" type="xrd:URIPriorityPattern"/>
+	<xs:element name="CanonicalEquivID" type="xrd:URIPriorityPattern"/>
+	<xs:element name="Service">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="xrd:ProviderID" minOccurs="0"/>
+				<xs:element ref="xrd:Type" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="xrd:Path" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="xrd:MediaType" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:choice>
+					<xs:element ref="xrd:URI" minOccurs="0" maxOccurs="unbounded"/>
+					<xs:element ref="xrd:Redirect" minOccurs="0" maxOccurs="unbounded"/>
+					<xs:element ref="xrd:Ref" minOccurs="0" maxOccurs="unbounded"/>
+				</xs:choice>
+				<xs:element ref="xrd:LocalID" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:group ref="xrd:otherelement" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attributeGroup ref="xrd:priorityAttrGrp"/>
+			<xs:attributeGroup ref="xrd:otherattribute"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="Type">
+		<xs:complexType>
+			<xs:simpleContent>
+				<xs:extension base="xrd:URIPattern">
+					<xs:attributeGroup ref="xrd:selectionAttrGrp"/>
+				</xs:extension>
+			</xs:simpleContent>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="Path" type="xrd:StringSelectionPattern"/>
+	<xs:element name="MediaType" type="xrd:StringSelectionPattern"/>
+	<xs:element name="URI" type="xrd:URIPriorityAppendPattern"/>
+</xs:schema>
\ No newline at end of file

Added: federation/trunk/picketlink-seam/src/main/resources/schema/xrds/xrds.xsd
===================================================================
--- federation/trunk/picketlink-seam/src/main/resources/schema/xrds/xrds.xsd	                        (rev 0)
+++ federation/trunk/picketlink-seam/src/main/resources/schema/xrds/xrds.xsd	2010-06-18 18:06:34 UTC (rev 315)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xrds="xri://$xrds" targetNamespace="xri://$xrds" elementFormDefault="qualified">
+	<!-- Utility patterns -->
+	<xs:attributeGroup name="otherattribute">
+		<xs:anyAttribute namespace="##other" processContents="lax"/>
+	</xs:attributeGroup>
+	<xs:group name="otherelement">
+		<xs:choice>
+			<xs:any namespace="##other" processContents="lax"/>
+			<xs:any namespace="##local" processContents="lax"/>
+		</xs:choice>
+	</xs:group>
+	<!-- Patterns for elements -->
+	<xs:element name="XRDS">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:group ref="xrds:otherelement" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:attributeGroup ref="xrds:otherattribute"/>
+			<!--XML Schema does not currently offer a means to express that only one of the following two attributes may be used in any XRDS element, i.e., an XRDS document may describe EITHER a redirect identifier or a ref identifier but not both.-->
+			<xs:attribute name="redirect" type="xs:anyURI" use="optional"/>
+			<xs:attribute name="ref" type="xs:anyURI" use="optional"/>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
\ No newline at end of file

Modified: federation/trunk/picketlink-webapps/seam-sp/src/main/webapp/PrincipalInfoFragment.xhtml
===================================================================
--- federation/trunk/picketlink-webapps/seam-sp/src/main/webapp/PrincipalInfoFragment.xhtml	2010-06-16 15:03:56 UTC (rev 314)
+++ federation/trunk/picketlink-webapps/seam-sp/src/main/webapp/PrincipalInfoFragment.xhtml	2010-06-18 18:06:34 UTC (rev 315)
@@ -6,7 +6,7 @@
 	xmlns:f="http://java.sun.com/jsf/core">
 	<c:choose>
 		<c:when
-			test="#{identity.principal.getClass().getSimpleName() == 'SamlPrincipal'}">
+			test="#{identity.principal.getClass().getSimpleName() == 'SeamSamlPrincipal'}">
 			<h2>Logged on via SAML</h2>
 			<h:panelGrid columns="2">
 				<h:outputText value="NameID" />

Modified: federation/trunk/picketlink-webapps/seam-sp/src/main/webapp/PublicPage.xhtml
===================================================================
--- federation/trunk/picketlink-webapps/seam-sp/src/main/webapp/PublicPage.xhtml	2010-06-16 15:03:56 UTC (rev 314)
+++ federation/trunk/picketlink-webapps/seam-sp/src/main/webapp/PublicPage.xhtml	2010-06-18 18:06:34 UTC (rev 315)
@@ -12,9 +12,11 @@
 	<p><h:commandLink action="/PrivatePage2.xhtml"
 		value="Click here to view private page 2." /></p>
 	<c:if test="#{configuration.serviceProvider.samlConfiguration!= null}">
-		<p><h:commandLink action="/MetaDataService.xhtml"
-			value="Click here to view meta data for the SAML SP (xml)." /></p>
+		<p><h:outputLink value="MetaDataService">Click here to view meta data for the SAML SP (application/xml).</h:outputLink></p>
 	</c:if>
+	<c:if test="#{configuration.serviceProvider.samlConfiguration!= null}">
+		<p><h:outputLink value="OpenIdXrdsService">Click here to view the XRDS file for the OpenID RP (application/xrds+xml).</h:outputLink></p>
+	</c:if>
 </h:form>
 </body>
 



More information about the jboss-cvs-commits mailing list