The SAML XML.org web site is not longer accepting new posts. Information on this page is preserved for legacy purposes only. For current information on SAML, please see the OASIS Security Services Technical Committee Wiki.

Revision of How to create SAML2XMLObject from Wed, 2013-05-15 13:46

I am using standard SAML2.0 Authentication engine for authentication purpose. I am able to access the JAVA objects using script attribute from SAML. But I need to send the XML objects as additional attributes in SAML response ( in assertion ). For this I am trying to hard code as below. If this works I can extend this to JAVA objects.

<resolver:AttributeDefinition id="TestAttr"
    xsi:type="Script" xmlns="urn:mace:shibboleth:2.0:resolver:ad">                                            
    <resolver:AttributeEncoder xsi:type="SAML2XMLObject"
   xmlns="urn:mace:shibboleth:2.0:attribute:encoder" name="TestAttr"
   nameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" />
   <Script><![CDATA[
     importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider);
     importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute);
    importPackage(Package edu.internet2.middleware.shibboleth.common.xmlobject);
     TestAttr = new BasicAttribute("TestAttr");
     var text="<node>";
    text=text+"<content>test</content>";
    text=text+"</node>";
    var parser=new DOMParser();
       TestAttr.getValues().add(parser.parseFromString(text,'text/xml'));          
  ]]></Script> 
  </resolver:AttributeDefinition>

Any pointers to fix this issue. Thanks in advance

XML.org Focus Areas: BPEL | DITA | ebXML | IDtrust | OpenDocument | SAML | UBL | UDDI
OASIS sites: OASIS | Cover Pages | XML.org | AMQP | CGM Open | eGov | Emergency | IDtrust | LegalXML | Open CSA | OSLC | WS-I