<style>
/* Changing the layout to use less space for mobiles */
@media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
    #email-body { min-width: 30em !important; }
    #email-page { padding: 8px !important; }
    #email-banner { padding: 8px 8px 0 8px !important; }
    #email-avatar { margin: 1px 8px 8px 0 !important; padding: 0 !important; }
    #email-fields { padding: 0 8px 8px 8px !important; }
    #email-gutter { width: 0 !important; }
}
</style>
<div id="email-body">
<table id="email-wrap" align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#f0f0f0;color:#000000;width:100%;">
    <tr valign="top">
        <td id="email-page" style="padding:16px !important;">
            <table align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#ffffff;border:1px solid #bbbbbb;color:#000000;width:100%;">
                <tr valign="top">
                    <td bgcolor="#ffffff" style="background-color:#ffffff;color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;line-height:1;"><img src="https://shibboleth.net/images/shib_240x83.png" alt="" style="vertical-align:top;" /></td>
                </tr><tr valign="top">
    <td id="email-banner" style="padding:32px 32px 0 32px;">

                
        
        
            <table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="width:100%;">
    <tr valign="top">
        <td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;padding:0;">
                                        <img id="email-avatar" src="https://issues.shibboleth.net/jira/secure/useravatar?avatarId=10202" alt="" height="48" width="48" border="0" align="left" style="padding:0;margin: 0 16px 16px 0;" />
                        <div id="email-action" style="padding: 0 0 8px 0;font-size:12px;line-height:18px;">
                                    <a class="user-hover" rel="slaughterb@missouri.edu" id="email_slaughterb@missouri.edu" href="https://issues.shibboleth.net/jira/secure/ViewProfile.jspa?name=slaughterb%40missouri.edu" style="color:#326ca6;">Slaughter</a>
     commented on <img src="https://issues.shibboleth.net/jira/images/icons/issuetypes/bug.png" height="16" width="16" border="0" align="absmiddle" alt="Bug"> <a style='color:#326ca6;text-decoration:none;' href='https://issues.shibboleth.net/jira/browse/SIDP-622'>SIDP-622</a>
            </div>
                        <div id="email-summary" style="font-size:16px;line-height:20px;padding:2px 0 16px 0;">
                <a style='color:#326ca6;text-decoration:none;' href='https://issues.shibboleth.net/jira/browse/SIDP-622'><strong>Scripted Attributes repeated in attribute statement under Java 8</strong></a>
            </div>
                    </td>
    </tr>
</table>
    </td>
</tr>
<tr valign="top">
    <td id="email-fields" style="padding:0 32px 32px 32px;">
        <table border="0" cellpadding="0" cellspacing="0" style="padding:0;text-align:left;width:100%;" width="100%">
            <tr valign="top">
                <td id="email-gutter" style="width:64px;white-space:nowrap;"></td>
                <td>
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr valign="top">
    <td colspan="2" style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 16px 0;width:100%;">
        <div class="comment-block" style="background-color:#edf5ff;border:1px solid #dddddd;color:#000000;padding:12px;"><p>Java environment - Java 8 using the native Nashorn engine. I considered using the Rhino engine alongside Nashorn, as suggested on the wiki, but that's not a good long-term solution (also from wiki), and since we don't have any other scripted attributes to port from Rhino to Nashorn, I didn't see any long term value to running Rhino under Java 8. My solution was to revert to the current version of Java 7 and use Rhino natively until the IdP can fully support Java 8, if that will be possible.</p>

<p><b>Attribute-Resolver.xml Excerpts</b></p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">&lt;resolver:AttributeDefinition id=<span class="code-quote">"scriptedAttribute"</span>
        xsi:type=<span class="code-quote">"Script"</span> xmlns=<span class="code-quote">"urn:mace:shibboleth:2.0:resolver:ad"</span>

        sourceAttributeID=<span class="code-quote">"scriptedAttribute"</span>&gt;


        <span class="code-tag">&lt;resolver:Dependency ref=<span class="code-quote">"ActiveDirectory"</span> /&gt;</span>
        <span class="code-tag">&lt;resolver:Dependency ref=<span class="code-quote">"scriptedAttributeDummy"</span> /&gt;</span>

        &lt;resolver:AttributeEncoder xsi:type=<span class="code-quote">"SAML1String"</span>

                xmlns=<span class="code-quote">"urn:mace:shibboleth:2.0:attribute:encoder"</span>

                name=<span class="code-quote">"urn:mace:campus.edu:attribute-def:scriptedAttribute"</span> /&gt;

        &lt;resolver:AttributeEncoder xsi:type=<span class="code-quote">"SAML2String"</span>

                xmlns=<span class="code-quote">"urn:mace:shibboleth:2.0:attribute:encoder"</span>

                name=<span class="code-quote">"urn:mace:campus.edu:attribute-def:scriptedAttribute"</span> 

                friendlyName=<span class="code-quote">"scriptedAttribute"</span> /&gt;

        <span class="code-tag">&lt;ad:Script&gt;</span>&lt;![CDATA[
                        scriptedAttribute.getValues().clear();
                        dn = distinguishedName.getValues().get(0);
                        domainDN = dn.match(new RegExp(<span class="code-quote">"DC=.*"</span>,<span class="code-quote">"i"</span>));
                        scriptedAttribute.getValues().add(domainDN[0]);
        ]]&gt;<span class="code-tag">&lt;/ad:Script&gt;</span>

<span class="code-tag">&lt;/resolver:AttributeDefinition&gt;</span>

     <span class="code-tag">&lt;resolver:DataConnector id=<span class="code-quote">"scriptedAttributeDummy"</span> xsi:type=<span class="code-quote">"Static"</span> xmlns=<span class="code-quote">"urn:mace:shibboleth:2.0:resolver:dc"</span>&gt;</span>

        <span class="code-tag">&lt;Attribute id=<span class="code-quote">"scriptedAttribute"</span>&gt;</span>

                <span class="code-tag">&lt;Value&gt;</span><span class="code-tag">&lt;/Value&gt;</span>

        <span class="code-tag">&lt;/Attribute&gt;</span>

<span class="code-tag">&lt;/resolver:DataConnector&gt;</span>


&lt;resolver:DataConnector xsi:type=<span class="code-quote">"LDAPDirectory"</span>

        xmlns=<span class="code-quote">"urn:mace:shibboleth:2.0:resolver:dc"</span>

        id=<span class="code-quote">"ActiveDirectory"</span>

        ldapURL=<span class="code-quote">"ldaps://ldap.campus.edu:3269"</span>

        baseDN=<span class="code-quote">"dc=edu"</span>

        principal=<span class="code-quote">"ldapuser@city.campus.edu"</span>

        principalCredential=<span class="code-quote">"ldappassword"</span>

        searchScope=<span class="code-quote">"SUBTREE"</span> &gt;

        <span class="code-tag">&lt;FilterTemplate&gt;</span>

                &lt;![CDATA[

                        (sAMAccountName=$requestContext.principalName)

                ]]&gt;

        <span class="code-tag">&lt;/FilterTemplate&gt;</span>

        <span class="code-tag">&lt;ReturnAttributes&gt;</span>sAMAccountName userPrincipalName mail displayName memberOf department msSFU30UidNumber sn givenName cn uid distinguishedName<span class="code-tag">&lt;/ReturnAttributes&gt;</span>

<span class="code-tag">&lt;/resolver:DataConnector&gt;</span>
</pre>
</div></div>

<p><b>Attribute Statement Examples</b></p>

<p>First authentication</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;saml2:AttributeStatement&gt;</span>
      <span class="code-tag">&lt;saml2:Attribute Name=<span class="code-quote">"urn:mace:dir:attribute-def:mail"</span> NameFormat=<span class="code-quote">"urn:oasis:names:tc:SAML:2.0:attrname-format:uri"</span>&gt;</span>
         <span class="code-tag">&lt;saml2:AttributeValue <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span> xsi:type=<span class="code-quote">"xs:string"</span>&gt;</span>doej@campus.edu<span class="code-tag">&lt;/saml2:AttributeValue&gt;</span>
      <span class="code-tag">&lt;/saml2:Attribute&gt;</span>
      <span class="code-tag">&lt;saml2:Attribute FriendlyName=<span class="code-quote">"scriptedAttribute"</span> Name=<span class="code-quote">"urn:mace:campus.edu:attribute-def:scriptedAttribute"</span> NameFormat=<span class="code-quote">"urn:oasis:names:tc:SAML:2.0:attrname-format:uri"</span>&gt;</span>
         <span class="code-tag">&lt;saml2:AttributeValue <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span> xsi:type=<span class="code-quote">"xs:string"</span>&gt;</span>DC=city,DC=campus,DC=edu<span class="code-tag">&lt;/saml2:AttributeValue&gt;</span>
      <span class="code-tag">&lt;/saml2:Attribute&gt;</span>
      <span class="code-tag">&lt;saml2:Attribute Name=<span class="code-quote">"urn:mace:dir:attribute-def:sn"</span> NameFormat=<span class="code-quote">"urn:oasis:names:tc:SAML:2.0:attrname-format:uri"</span>&gt;</span>
         <span class="code-tag">&lt;saml2:AttributeValue <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span> xsi:type=<span class="code-quote">"xs:string"</span>&gt;</span>Doe<span class="code-tag">&lt;/saml2:AttributeValue&gt;</span>
      <span class="code-tag">&lt;/saml2:Attribute&gt;</span>
      <span class="code-tag">&lt;saml2:Attribute Name=<span class="code-quote">"urn:mace:dir:attribute-def:givenName"</span> NameFormat=<span class="code-quote">"urn:oasis:names:tc:SAML:2.0:attrname-format:uri"</span>&gt;</span>
         <span class="code-tag">&lt;saml2:AttributeValue <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span> xsi:type=<span class="code-quote">"xs:string"</span>&gt;</span>John<span class="code-tag">&lt;/saml2:AttributeValue&gt;</span>
      <span class="code-tag">&lt;/saml2:Attribute&gt;</span>
   <span class="code-tag">&lt;/saml2:AttributeStatement&gt;</span>
</pre>
</div></div>

<p>After second authentication (different user)</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;saml2:AttributeStatement&gt;</span>
      <span class="code-tag">&lt;saml2:Attribute Name=<span class="code-quote">"urn:mace:dir:attribute-def:mail"</span> NameFormat=<span class="code-quote">"urn:oasis:names:tc:SAML:2.0:attrname-format:uri"</span>&gt;</span>
         <span class="code-tag">&lt;saml2:AttributeValue <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span> xsi:type=<span class="code-quote">"xs:string"</span>&gt;</span>smithj@campus.edu<span class="code-tag">&lt;/saml2:AttributeValue&gt;</span>
      <span class="code-tag">&lt;/saml2:Attribute&gt;</span>
      <span class="code-tag">&lt;saml2:Attribute FriendlyName=<span class="code-quote">"scriptedAttribute"</span> Name=<span class="code-quote">"urn:mace:campus.edu:attribute-def:scriptedAttribute"</span> NameFormat=<span class="code-quote">"urn:oasis:names:tc:SAML:2.0:attrname-format:uri"</span>&gt;</span>
         <span class="code-tag">&lt;saml2:AttributeValue <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span> xsi:type=<span class="code-quote">"xs:string"</span>&gt;</span>DC=city2,DC=campus,DC=edu<span class="code-tag">&lt;/saml2:AttributeValue&gt;</span>
      <span class="code-tag">&lt;/saml2:Attribute&gt;</span>
      <span class="code-tag">&lt;saml2:Attribute FriendlyName=<span class="code-quote">"scriptedAttribute"</span> Name=<span class="code-quote">"urn:mace:campus.edu:attribute-def:scriptedAttribute"</span> NameFormat=<span class="code-quote">"urn:oasis:names:tc:SAML:2.0:attrname-format:uri"</span>&gt;</span>
         <span class="code-tag">&lt;saml2:AttributeValue <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span> xsi:type=<span class="code-quote">"xs:string"</span>&gt;</span>DC=city2,DC=campus,DC=edu<span class="code-tag">&lt;/saml2:AttributeValue&gt;</span>
      <span class="code-tag">&lt;/saml2:Attribute&gt;</span>
      <span class="code-tag">&lt;saml2:Attribute Name=<span class="code-quote">"urn:mace:dir:attribute-def:sn"</span> NameFormat=<span class="code-quote">"urn:oasis:names:tc:SAML:2.0:attrname-format:uri"</span>&gt;</span>
         <span class="code-tag">&lt;saml2:AttributeValue <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span> xsi:type=<span class="code-quote">"xs:string"</span>&gt;</span>Jane<span class="code-tag">&lt;/saml2:AttributeValue&gt;</span>
      <span class="code-tag">&lt;/saml2:Attribute&gt;</span>
      <span class="code-tag">&lt;saml2:Attribute Name=<span class="code-quote">"urn:mace:dir:attribute-def:givenName"</span> NameFormat=<span class="code-quote">"urn:oasis:names:tc:SAML:2.0:attrname-format:uri"</span>&gt;</span>
         <span class="code-tag">&lt;saml2:AttributeValue <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span> xsi:type=<span class="code-quote">"xs:string"</span>&gt;</span>Smith<span class="code-tag">&lt;/saml2:AttributeValue&gt;</span>
      <span class="code-tag">&lt;/saml2:Attribute&gt;</span>
   <span class="code-tag">&lt;/saml2:AttributeStatement&gt;</span>
</pre>
</div></div>

<p>Additional scriptedAttribute Attribute added to every subsequent login, though each only carries the authenticated user's attribute value(s). Removing "scriptedAttribute.clear();" from the script block causes every repeated Attribute block to contain all unique values for all authenticated users.</p></div>
        <div style="color:#505050;padding:4px 0 0 0;">                </div>
    </td>
</tr>
                    </table>
                </td>
            </tr>
        </table>
    </td>
</tr>













            </table>
        </td><!-- End #email-page -->
    </tr>
    <tr valign="top">
        <td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:10px;line-height:14px;padding: 0 16px 16px 16px;text-align:center;">
            This message is automatically generated by JIRA.<br />
            If you think it was sent incorrectly, please contact your JIRA administrators<br />
            For more information on JIRA, see: <a style='color:#326ca6;' href='http://www.atlassian.com/software/jira'>http://www.atlassian.com/software/jira</a>
        </td>
    </tr>
</table><!-- End #email-wrap -->
</div><!-- End #email-body -->