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.

Diff for How to create SAML2XMLObject

Wed, 2013-05-15 13:46 by kotesh201Wed, 2013-05-15 14:07 by kotesh201

This is the status message getting back in the response. Required NameID format not supported

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

How to create SAML2XMLObject

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