samuel xal takes shape

Mon, Dec 12, 2005

The XAL for SAMUEL is coming along nicely, with the following package structure now in place:

XAL Package Structure

The idea is to use the SAMLFactoryProvider to load a SAMLFactory, which provides SAML schema objects, either empty, ready for building SAML packets, or initialised from existing SAML XML.

A SAMLFactory can either load up a direct implementation of the SAML schema or, in the case of the default XMLBeans SAMLFactory, it loads up a delegation layer which delegates calls to the underlying XMLBeans schema implementation. This is quite a complex implementation of SAMLFactory.

The previous version of SAMUEL could, theoretically, be modified to provide a SAMLFactory and a direct coupling to the schema but that would involve implementing the schema directly. I did this for the SAML2 Metadata but it’s not easy!

XMLBeans provides the complete SAML schema implementation by the following files:

Ant build file

<project name=“SAMLMetadata” default=“all”>   <taskdef name=“xmlbean” classname=“org.apache.xmlbeans.impl.tool.XMLBean” classpath=“/usr/local/xmlbeans/lib/xbean.jar:/usr/local/xmlbeans/lib/jsr173_api.jar” />

  <!– CLASSPATH –>   <path id=“classpath”>     <pathelement path=“/usr/local/xmlbeans/lib/xbean.jar” />     <pathelement path=“/usr/local/xmlbeans/lib/jsr173_api.jar” />     <pathelement path=“lib/saml-2.0.jar” />   </path>

  <!– Specifying a schema directory instead of a schema file will pick up the .xsdconfig file –>

  <target name=“saml1.1”>     <xmlbean schema=“xsd/saml/1.1”              download=“true”              srcgendir=“beansrc-saml1”              destfile=“lib/saml-1.1.jar”              classpath=“/usr/local/xmlbeans/lib/xbean.jar:/usr/local/xmlbeans/lib/jsr173_api.jar”>     </xmlbean>   </target>

  <target name=“saml2.0”>     <xmlbean schema=“xsd/saml/2.0”              download=“true”              srcgendir=“beansrc-saml2”              destfile=“lib/saml-2.0.jar”              classpath=“/usr/local/xmlbeans/lib/xbean.jar:/usr/local/xmlbeans/lib/jsr173_api.jar”>     </xmlbean>   </target>

  <target name=“guanxi”>     <xmlbean schema=“xsd/guanxi”              download=“true”              srcgendir=“beansrc-guanxi”              destfile=“lib/guanxi-sp-beans.jar”>       <classpath refid=“classpath”/>     </xmlbean>   </target>

  <target name=“all” depends=“saml1.1,saml2.0,guanxi”/>

</project>

saml.xsdconfig

<xb:config xmlns:xb=“http://xml.apache.org/xmlbeans/2004/02/xbean/config"            xmlns:samlp=“urn:oasis:names:tc:SAML:1.0:protocol”            xmlns:saml=“urn:oasis:names:tc:SAML:1.0:assertion”            xmlns:ds=“http://www.w3.org/2000/09/xmldsig#"            xmlns=“http://www.w3.org/2001/XMLSchema">

  <xb:namespace uri=“urn:oasis:names:tc:SAML:1.0:protocol”>     <xb:package>org.guanxi.samuel.xal.schemaimpl.xmlbeans.saml_1_1.protocol</xb:package>   </xb:namespace>

  <xb:namespace uri=“urn:oasis:names:tc:SAML:1.0:assertion”>     <xb:package>org.guanxi.samuel.xal.schemaimpl.xmlbeans.saml_1_1.assertion</xb:package>   </xb:namespace>

  <xb:namespace uri=“http://www.w3.org/2000/09/xmldsig#">     <xb:package>org.guanxi.samuel.xal.schemaimpl.xmlbeans.saml_1_1.w3</xb:package>   </xb:namespace>

  <xb:namespace uri=“http://www.w3.org/2001/XMLSchema">     <xb:package>org.guanxi.samuel.xal.schemaimpl.xmlbeans.saml_1_1.w3</xb:package>   </xb:namespace>

</xb:config>

comments powered by Disqus