<!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: Mapping Application Roles to Declarative Role
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/MartinBorgman">Martin Borgman</a> in <i>PicketBox Development</i> - <a href="http://community.jboss.org/message/571554#571554">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><blockquote class="jive-quote"><p>Sohil Shah wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Since it makes sense to associate this mapping at the security-domain level to be utilized at different layers of the app (not just ejb and web)(I am thinking Portal,SEAM, JBPM etc)</p></blockquote><p>It makes absolutely no sense at all to do this at the security domain level.</p><p>Let me give you an example.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have 2 applications running on a JBoss instance.</p><p>Both applications use basic authentication using a single company wide active directory configuration.</p><p>Both applications use a common user role called "user" and an application administrator called "admin"</p><p>The role names "admin" and "user" are defined in the standard deployment descriptors. This is as it should be right?</p><p>Now a user for application 1 may not have any rights to use application 2</p><p>Another user may have admin rights for application 1 and only user rights for application two.</p><p>Since both applications use the same company wide authentication / authorization it make sense to define a single security domain, but if I do that I cannot differentiate between the rights for the two applications by using a domain level role mapper.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p>Sohil Shah wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>wouldn't it make sense to extend the configuration options in the login-config.xml so that you can specify the role/identity mappings kind of like this:<br/><br/> &lt;application-policy name="security-domain-name"&gt;<br/><br/> &lt;login-module&gt;blahblah&lt;/login-module&gt;<br/><br/> &lt;role-mapping&gt;<br/><br/> &lt;application-role&gt;whatever role from login module&lt;/application-role&gt;<br/> &lt;deployment-role&gt;whatever deployment role it should map to&lt;/deployment-role&gt;<br/><br/> &lt;/role-mapping&gt;<br/> &lt;/application-policy&gt;<br/><br/>Ofcourse this is just an example, and definitely needs better element names<br/></p></blockquote><p>This is a stupid idea. Think about PaaS. Applications move from application server to application server. You don't want to change your login-config every time you move your application to a different application server. While it is possible to deploy a login config with the application or make it part of the deployment unit. This would still mean you create a new security domain for every application you deploy and that would certainly be a waste of resources and a security nightmare.</p><p>It would be much better to remap roles in the container specific deployment descriptors.</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/571554#571554">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>