<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: Make JBossPDP an interface to allow easier insertion of custom PDP.
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/bkrisler">Brian Krisler</a> in <i>PicketBox Development</i> - <a href="http://community.jboss.org/message/560787#560787">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>What I mean by attributes for a subject is the following.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>At the moment, this is a typical policy subject block from a request:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;Subject&gt;</span>
&#160; <span class="jive-xml-tag">&lt;SubjectMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag"><span>&lt;AttributeValue DataType="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema#string" target="_blank">http://www.w3.org/2001/XMLSchema#string</a><span>"&gt;</span></span>Manager<span class="jive-xml-tag">&lt;/AttributeValue&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag"><span>&lt;SubjectAttributeDesignator AttributeId="urn:oasis:names:tc:xacml:2.0:subject:role"
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DataType="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema#string" target="_blank">http://www.w3.org/2001/XMLSchema#string</a><span>" /&gt;</span></span>
&#160;&#160; <span class="jive-xml-tag">&lt;/SubjectMatch&gt;</span>
&#160;&#160; <span class="jive-xml-tag">&lt;SubjectMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"&gt;</span>
&#160;&#160;&#160;&#160; <span class="jive-xml-tag"><span>&lt;AttributeValue DataType="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema#string" target="_blank">http://www.w3.org/2001/XMLSchema#string</a><span>"&gt;</span></span>Developer<span class="jive-xml-tag">&lt;/AttributeValue&gt;</span>
&#160;&#160;&#160;&#160; <span class="jive-xml-tag"><span>&lt;SubjectAttributeDesignator AttributeId="urn:oasis:names:tc:xacml:2.0:subject:role"
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DataType="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema#string" target="_blank">http://www.w3.org/2001/XMLSchema#string</a><span>" /&gt;</span></span>
&#160;&#160; <span class="jive-xml-tag">&lt;/SubjectMatch&gt;</span>
<span class="jive-xml-tag">&lt;/Subject&gt;</span>

</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>When a request is made against this policy, it would be in the form of a user id (Bob) and his roles (Manager), this is supporting role-based authorization.&#160; However for attribute-based authorization, the policy would look more like:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;Subject&gt;</span>
&#160; <span class="jive-xml-tag">&lt;SubjectMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:boolean-equal"&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag"><span>&lt;AttributeValue DataType="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema#boolean" target="_blank">http://www.w3.org/2001/XMLSchema#boolean</a><span>"&gt;</span></span>true<span class="jive-xml-tag">&lt;/AttributeValue&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag"><span>&lt;SubjectAttributeDesignator AttributeId="urn:my-org:manager:attribute"
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DataType="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema#boolean" target="_blank">http://www.w3.org/2001/XMLSchema#boolean</a><span>" /&gt;</span></span>
&#160;&#160; <span class="jive-xml-tag">&lt;/SubjectMatch&gt;</span>
&#160;&#160; <span class="jive-xml-tag">&lt;SubjectMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:boolean-equal"&gt;</span>
&#160;&#160;&#160;&#160; <span class="jive-xml-tag"><span>&lt;AttributeValue DataType="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema#boolean" target="_blank">http://www.w3.org/2001/XMLSchema#boolean</a><span>"&gt;</span></span>true<span class="jive-xml-tag">&lt;/AttributeValue&gt;</span>
&#160;&#160;&#160;&#160; <span class="jive-xml-tag"><span>&lt;SubjectAttributeDesignator AttributeId="urn:my-org:developer:attribute"
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DataType="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema#boolean" target="_blank">http://www.w3.org/2001/XMLSchema#boolean</a><span>" /&gt;</span></span>
&#160;&#160; <span class="jive-xml-tag">&lt;/SubjectMatch&gt;</span>
<span class="jive-xml-tag">&lt;/Subject&gt;</span></code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>When a request is made against the attribute-based policy the requestor would pass in a list of values as such:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>urn:my-org:manager:attribute = true</p><p>urn:my-org:developer:attribute = false</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In a review of the existing code (EJBXACMLUtil,java for example), it does not allow for such attribute-based values. Instead, it loops over the provided roles and creates the attributes based on the ATTRIBUTEID_ROLE constant.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">List&lt;Role&gt; rolesList = callerRoles.getRoles();
<font color="navy"><b>if</b></font>(rolesList != <font color="navy"><b>null</b></font>)
<font color="navy">{</font>
&#160;&#160; <font color="navy"><b>for</b></font>(Role role:rolesList)
&#160;&#160; <font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160; String roleName = role.getRoleName(); 
&#160;&#160;&#160;&#160;&#160; AttributeType attSubjectID = RequestAttributeFactory.createStringAttributeType(
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; XACMLConstants.ATTRIBUTEID_ROLE, <font color="red">"jboss.org"</font>, roleName);
&#160;&#160;&#160;&#160;&#160; subject.getAttribute().add(attSubjectID);
&#160;&#160; <font color="navy">}</font>
<font color="navy">}</font>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>An other issue is that the construction of the request is dependent upon the Principal for setting of the subject-id value. We are working on a model where there will never be a Princial object to extract a subject-id. In our case, we will instead pass in a set of attributes for evaluation.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Upon further review, it might just be the helper methods (EJBXAMLUtil and WebXACMLUtil) that will require much modification. The addition of a second method in the util objects for creating of these attribute based request objects might just work.&#160; I have not fully reviewed the policy application code in detail yet, but from a cursory glance it appears to be attribute-id agnostic and will just create a Set of attribute/value pairs and then upon validation, apply the proper attribute function.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Brian</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Message was edited by: Brian Krisler&#160; -- Tried to fix XML formatting.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/560787#560787">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in PicketBox Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2088">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>