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 kotesh201 | Wed, 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 4 | Line 4 | ||
<p>
| <p>
| ||
<resolver:AttributeDefinition id="TestAttr"<br />
| <resolver:AttributeDefinition id="TestAttr"<br />
| ||
- | xsi:type="Script" xmlns="urn:mace:shibboleth:2.0:resolver:ad"> <br />
| + | xsi:type="Script" xmlns="urn:mace:shibboleth:2.0:resolver:ad"> <br />
|
- | <resolver:AttributeEncoder xsi:type="SAML2XMLObject"<br />
| + | <resolver:AttributeEncoder xsi:type="SAML2XMLObject"<br />
|
- | xmlns="urn:mace:shibboleth:2.0:attribute:encoder" name="TestAttr"<br />
| + | xmlns="urn:mace:shibboleth:2.0:attribute:encoder" name="TestAttr"<br />
|
- | nameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" /><br />
| + | nameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" /><br />
|
- | <Script><![CDATA[<br />
| + | <Script><![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("TestAttr");<br />
| + | TestAttr = new BasicAttribute("TestAttr");<br />
|
- | var text="<node>";<br />
| + | var text="<node>";<br />
|
- | text=text+"<content>test</content>";<br />
| + | text=text+"<content>test</content>";<br />
|
- | text=text+"</node>"; <br />
| + | text=text+"</node>"; <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 />
|
- | ]]></Script> <br />
| + | ]]></Script> <br />
|
- | </resolver:AttributeDefinition>
| + | </resolver:AttributeDefinition>
|
</p>
| </p>
| ||
<p>
| <p>
|
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