<!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;">
    Guvnor Security
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/roxy1987">roxy1987</a> in <i>Beginner's Corner</i> - <a href="http://community.jboss.org/message/576759#576759">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>I am trying to add authentication to the guvnor console.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>My <span style="text-decoration: underline;">WEB-INF/components.xml</span> is like this :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>&lt;?xml version="1.0" encoding="UTF-8"?&gt; <br/><span>&lt;components xmlns="</span><a class="jive-link-external-small" href="http://jboss.com/products/seam/components" target="_blank">http://jboss.com/products/seam/components</a><span>" </span><br/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:core="</span><a class="jive-link-external-small" href="http://jboss.com/products/seam/core" target="_blank">http://jboss.com/products/seam/core</a><span>" </span><br/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:security="</span><a class="jive-link-external-small" href="http://jboss.com/products/seam/security" target="_blank">http://jboss.com/products/seam/security</a><span>" </span><br/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:web="</span><a class="jive-link-external-small" href="http://jboss.com/products/seam/web" target="_blank">http://jboss.com/products/seam/web</a><span>" </span><br/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>" </span><br/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:transaction="</span><a class="jive-link-external-small" href="http://jboss.com/products/seam/transaction" target="_blank">http://jboss.com/products/seam/transaction</a><span>" </span><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xsi:schemaLocation= <br/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "</span><a class="jive-link-external-small" href="http://jboss.com/products/seam/core" target="_blank">http://jboss.com/products/seam/core</a><span> </span><a class="jive-link-external-small" href="http://jboss.com/products/seam/core-2.0.xsd" target="_blank">http://jboss.com/products/seam/core-2.0.xsd</a><span> </span><br/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><a class="jive-link-external-small" href="http://jboss.com/products/seam/security" target="_blank">http://jboss.com/products/seam/security</a><span> </span><a class="jive-link-external-small" href="http://jboss.com/products/seam/security-2.0.xsd" target="_blank">http://jboss.com/products/seam/security-2.0.xsd</a><span> </span><br/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><a class="jive-link-external-small" href="http://jboss.com/products/seam/components" target="_blank">http://jboss.com/products/seam/components</a><span> </span><a class="jive-link-external-small" href="http://jboss.com/products/seam/components-2.0.xsd" target="_blank">http://jboss.com/products/seam/components-2.0.xsd</a><span> </span><br/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><a class="jive-link-external-small" href="http://jboss.com/products/seam/web" target="_blank">http://jboss.com/products/seam/web</a><span> </span><a class="jive-link-external-small" href="http://jboss.com/products/seam/web-2.0.xsd" target="_blank">http://jboss.com/products/seam/web-2.0.xsd</a><span> </span><br/><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><a class="jive-link-external-small" href="http://jboss.com/products/seam/transaction" target="_blank">http://jboss.com/products/seam/transaction</a><span> </span><a class="jive-link-external-small" href="http://jboss.com/products/seam/transaction-2.0.xsd" target="_blank">http://jboss.com/products/seam/transaction-2.0.xsd</a><span>"&gt; </span><br/> <br/> <br/>&#160;&#160;&#160; &lt;core:init transaction-management-enabled="false"/&gt; <br/>&#160;&#160;&#160; &lt;transaction:no-transaction/&gt; <br/> <br/>&#160;&#160;&#160; &lt;component name="repositoryConfiguration"&gt; <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; *** This is for configuring the "home" directory for the repo storage. the directory must exist.&#160;&#160;&#160;&#160; *** <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name="homeDirectory"&gt;/home/michael/RulesRepository_001&lt;/property&gt; <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt; <br/> <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Optional: this is for creating a configurator for a seperate repository type. <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name="configurator"&gt;org.drools.repository.JackrabbitRepositoryConfigurator&lt;/property&gt; <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt; <br/>&#160;&#160;&#160; &lt;/component&gt; <br/> <br/>&#160;&#160;&#160; &lt;!-- SECURITY IDENTITY CONFIGURATION --&gt; <br/> <br/>&#160;&#160;&#160; &lt;!-- default (will take any username, useful if you want to keep track of users but not authenticate&#160; <br/>&#160;&#160;&#160; &lt;security:identity authenticate-method="#{defaultAuthenticator.authenticate}"/&gt; --&gt; <br/> <br/> <br/>&#160;&#160;&#160; &lt;!-- NO authentication. This will bypass the login screen when you hit the app. Everyone is "guest" --&gt; <br/>&#160;&#160;&#160; &lt;!-- &lt;security:identity authenticate-method="#{nilAuthenticator.authenticate}"/&gt; --&gt; <br/> <br/> <br/>&#160;&#160;&#160; &lt;!-- FOR EXAMPLE: the following one will use the jaas configuration called "other" - which in jboss AS means you can use properties files for users: --&gt; <br/>&#160;&#160;&#160; &lt;security:identity authenticate-method="#{authenticator.authenticate}" jaas-config-name="other"/&gt; <br/> <br/>&#160;&#160;&#160; &lt;!-- as JAAS is used you can use container specific ones to link up to your login services, eg LDAP/AD etc --&gt; <br/> <br/>&#160;&#160;&#160; &lt;!-- SECURITY AUTHORIZATION CONFIGURATION --&gt; <br/>&#160;&#160;&#160; &lt;!-- This is used to enable or disable role-based authorization. By default it is disabled. --&gt; <br/>&#160;&#160;&#160; &lt;security:role-based-permission-resolver enable-role-based-authorization="true"/&gt; <br/> <br/>&lt;/components&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="text-decoration: underline;">server/default/conf/login-config.xml</span> looks like this :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>&lt;?xml version='1.0'?&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>&lt;!-- The XML based JAAS login configuration read by the<br/>org.jboss.security.auth.login.XMLLoginConfig mbean. Add<br/>an application-policy element for each security domain.</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>The outline of the application-policy is:<br/>&lt;application-policy name="security-domain-name"&gt;<br/>&#160; &lt;authentication&gt;<br/>&#160;&#160;&#160; &lt;login-module code="login.module1.class.name" flag="control_flag"&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;module-option name = "option1-name"&gt;option1-value&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;module-option name = "option2-name"&gt;option2-value&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160; ...<br/>&#160;&#160;&#160; &lt;/login-module&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>&#160;&#160;&#160; &lt;login-module code="login.module2.class.name" flag="control_flag"&gt;<br/>&#160;&#160;&#160;&#160;&#160; ...<br/>&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160; ...<br/>&#160; &lt;/authentication&gt;<br/>&lt;/application-policy&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong><span>$Id: login-config.xml 76444 2008-07-29 23:50:53Z </span><a class="jive-link-email-small" href="mailto:sguilhen@redhat.com" target="_blank">sguilhen@redhat.com</a><span> $</span><br/>$Revision: 76444 $<br/>--&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>&lt;policy&gt;<br/>&#160; &lt;!-- Used by clients within the application server VM such as<br/>&#160; mbeans and servlets that access EJBs.<br/>&#160; --&gt;<br/>&#160; &lt;application-policy name="client-login"&gt;<br/>&#160;&#160;&#160; &lt;authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;login-module code="org.jboss.security.ClientLoginModule"<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; flag="required"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Any existing security context will be restored on logout --&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="restore-login-identity"&gt;true&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160; &lt;/authentication&gt;<br/>&#160; &lt;/application-policy&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>&#160; &lt;!-- Security domains for testing new jca framework --&gt;<br/>&#160; &lt;application-policy name="HsqlDbRealm"&gt;<br/>&#160;&#160;&#160; &lt;authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;login-module code="org.jboss.resource.security.ConfiguredIdentityLoginModule"<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; flag="required"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="principal"&gt;sa&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="userName"&gt;sa&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="password"&gt;&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="managedConnectionFactoryName"&gt;jboss.jca:service=LocalTxCM,name=DefaultDS&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160; &lt;/authentication&gt;<br/>&#160; &lt;/application-policy&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>&#160; &lt;application-policy name="JmsXARealm"&gt;<br/>&#160;&#160;&#160; &lt;authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;login-module code="org.jboss.resource.security.ConfiguredIdentityLoginModule"<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; flag="required"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="principal"&gt;guest&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="userName"&gt;guest&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="password"&gt;guest&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="managedConnectionFactoryName"&gt;jboss.jca:service=TxCM,name=JmsXA&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160; &lt;/authentication&gt;<br/>&#160; &lt;/application-policy&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>&#160; &lt;!-- A template configuration for the jmx-console web application. This<br/>&#160;&#160;&#160; defaults to the UsersRolesLoginModule the same as other and should be<br/>&#160;&#160;&#160; changed to a stronger authentication mechanism as required.<br/>&#160; --&gt;<br/>&#160; &lt;application-policy name="jmx-console"&gt;<br/>&#160;&#160;&#160; &lt;authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; flag="required"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="usersProperties"&gt;props/jmx-console-users.properties&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="rolesProperties"&gt;props/jmx-console-roles.properties&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160; &lt;/authentication&gt;<br/>&#160; &lt;/application-policy&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>&#160; &lt;!-- A template configuration for the web-console web application. This<br/>&#160;&#160;&#160; defaults to the UsersRolesLoginModule the same as other and should be<br/>&#160;&#160;&#160; changed to a stronger authentication mechanism as required.<br/>&#160; --&gt;<br/>&#160; &lt;application-policy name="web-console"&gt;<br/>&#160;&#160;&#160; &lt;authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; flag="required"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="usersProperties"&gt;web-console-users.properties&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="rolesProperties"&gt;web-console-roles.properties&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160; &lt;/authentication&gt;<br/>&#160; &lt;/application-policy&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>&#160; &lt;!--<br/>&#160;&#160;&#160; A template configuration for the JBossWS security domain.<br/>&#160;&#160;&#160; This defaults to the UsersRolesLoginModule the same as other and should be<br/>&#160;&#160;&#160; changed to a stronger authentication mechanism as required.<br/>&#160; --&gt;<br/>&#160; &lt;application-policy name="JBossWS"&gt;<br/>&#160;&#160;&#160; &lt;authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; flag="required"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="usersProperties"&gt;props/jbossws-users.properties&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="rolesProperties"&gt;props/jbossws-roles.properties&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="unauthenticatedIdentity"&gt;anonymous&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160; &lt;/authentication&gt;<br/>&#160; &lt;/application-policy&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>&#160; &lt;!-- The default login configuration used by any security domain that<br/>&#160; does not have a application-policy entry with a matching name<br/>&#160; --&gt;<br/>&#160; &lt;application-policy name="other"&gt;<br/>&#160;&#160;&#160; &lt;!-- A simple server login module, which can be used when the number<br/>&#160;&#160;&#160; of users is relatively small. It uses two properties files:<br/>&#160;&#160;&#160; users.properties, which holds users (key) and their password (value).<br/>&#160;&#160;&#160; roles.properties, which holds users (key) and a comma-separated list of<br/>&#160;&#160;&#160; their roles (value).<br/>&#160;&#160;&#160; The unauthenticatedIdentity property defines the name of the principal<br/>&#160;&#160;&#160; that will be used when a null username and password are presented as is<br/>&#160;&#160;&#160; the case for an unuathenticated web client or MDB. If you want to<br/>&#160;&#160;&#160; allow such users to be authenticated add the property, e.g.,<br/>&#160;&#160;&#160; unauthenticatedIdentity="nobody"<br/>&#160;&#160;&#160; --&gt;<br/>&#160;&#160;&#160; &lt;authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required"&gt;<br/>&#160;&#160;&#160; &lt;module-option name="usersProperties"&gt;props/guvnor-users.properties&lt;/module-option&gt;<br/>&#160;&#160;&#160; &lt;module-option name="rolesProperties"&gt;props/guvnor-roles.properties&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160; &lt;/authentication&gt;<br/>&#160; &lt;/application-policy&gt;<br/>&lt;/policy&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Also I have created the two files <strong>guvnor-users.properties.xml</strong> and <strong>guvnor-roles.properties.xml</strong> and put these files in props folder.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>But the password and username i provided doesnt work. <span style="text-decoration: underline;">What is wrong with the code</span>???</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/576759#576759">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>