Hi,
I am using Shibboleth Idp to act as Identity provider. I have two specific questions.

 

Question 1)

 

I am using SAML2 authentication engine. I would like to log the SAML Request coming from SP AND SAML Response sent from IdP. How do I intercept the request and response using standard Shibboleth idp-metadata.xml or attribute-resolver.xml or handler.xml
 
 

======================

Question 2 )


I am able to access the application JAVA objects using script attributes. But I need to send the XML content as additional attributes in SAML authentication response ( in assertion ). For this I am trying to hard code as below. If this works I can extend this to JAVA objects which can return XML.
  
<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" />
 &lt;Script&gt;&lt;![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(&quot;TestAttr&quot;);
 var text=&quot;&lt;node&gt;&quot;;
  text=text+&quot;&lt;content&gt;test&lt;/content&gt;&quot;;
 text=text+&quot;&lt;/node&gt;&quot;; 
var parser=new DOMParser();
 TestAttr.getValues().add(parser.parseFromString(text,'text/xml'));          
 ]]&gt;&lt;/Script&gt; 
 </resolver:AttributeDefinition> 


I am getting below status message in SAML response 

    <saml2p:Status>
        <saml2p:StatusCode
            Value="urn:oasis:names:tc:SAML:2.0:status:Responder">
             <saml2p:StatusCode
                Value="urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy"/>
        </saml2p:StatusCode>
        <saml2p:StatusMessage>
            Required NameID format not supported
         </saml2p:StatusMessage>
    &lt;/saml2p:Status

 

==

 

All I need to create the attributes in the Assertion something like this.

 

  &lt;saml2:AttributeStatement&gt;
             <saml2:Attribute
                Name="TestAttr1"
                NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml2:AttributeValue
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:type="xs:string">
                   Test1
                </saml2:AttributeValue>
            </saml2:Attribute>
            <saml2:Attribute
                Name="TestAttr2"
                 NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml2:AttributeValue
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:type="xs:string">
<i><b>                    <?xml version="1.0" encoding="ISO-8859-1"?>
                    <note> 
                     <to>Tove</to>
                      <from>Jani</from> 
                     <heading>Reminder</heading> 
                     &lt;body&gt;Don't forget me this weekend!&lt;/body&gt; 
                    </note></b></i>
                 </saml2:AttributeValue>
            </saml2:Attribute>
            <saml2:Attribute
                Name="SubjectDN"
                NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                 <saml2:AttributeValue
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:type="xs:string">
                     cn=tt,ou=uu,o=bb,o=oo
                </saml2:AttributeValue>
            </saml2:Attribute>  

  </saml2:AttributeStatement>

 


Any pointers to generate the XML message in the Attribute. Thanks in advance

        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://shibboleth.1660669.n2.nabble.com/Help-needed-to-create-XML-message-in-SAML-response-attribute-tp7586843.html">Help needed to create XML message in SAML response attribute</a><br/>
Sent from the <a href="http://shibboleth.1660669.n2.nabble.com/Shibboleth-Users-f1660767.html">Shibboleth - Users mailing list archive</a> at Nabble.com.<br/>