<!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="https://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;">
JAAS Login issue
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/ionutvaidianu">ionutvaidianu</a> in <i>Beginner's Corner</i> - <a href="https://community.jboss.org/message/728886#728886">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hello,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I'm quite new to JBoss AS, so please bare with me and any help is appreciated.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Here is my problem: I have a RichFaces web application and I want to restrict access to most of the pages. As far as I have found so far the best way (opened for suggetions and debate here) to secure content is at container level by defining a security domain and a module that will authorize the users so they can be able to access secured pages. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I have done all the configuration, the pages are protected, but even from a user that authenticates. In other words event after authentication I get redirected to the login page and cannot access any of the protected pages. I get no error / message in the server console (The log level for CONSOLE is on DEBUG).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Is it a known issue, is there a WA for it or am I doing something wrong?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Here is the setup:</p><p>JBoss AS 7.1.1 Final, standalone configuration.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The security domain (the associated datasource is functional because at some point I got wrong password in the server console):</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>                <security-domain name="SecuredRealm"></p><p>                    <authentication></p><p>                        <login-module code="Database" flag="required"></p><p>                            <module-option name="dsJndiName" value="java:jboss/datasources/securityDS"/></p><p>                            <module-option name="principalsQuery" value="select passwd from Users where username=?"/></p><p>                            <module-option name="rolesQuery" value="select userRoles,'Roles' from UserRoles where username=?"/></p><p>                            <module-option name="hashAlgorithm" value="MD5"/></p><p>                            <module-option name="hashEncoding" value="base64"/></p><p>                            <module-option name="unauthenticatedIdentity" value="guest"/></p><p>                            <module-option name="maxInvalidLoginAttempts" value="5"/></p><p>                        </login-module></p><p>                    </authentication></p><p>                </security-domain></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>jboss-web.xml</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><?xml version="1.0" encoding="UTF-8"?></p><p><jboss-web></p><p>    <security-domain>java:/jaas/SecuredRealm</security-domain></p><p></jboss-web></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>web.xml</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";"><br/></td><td style=";"><security-constraint></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><web-resource-collection></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";"><web-resource-name>SecuredRealm</web-resource-name></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";"><url-pattern>/*</url-pattern></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";"><http-method>GET</http-method></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";"><http-method>POST</http-method></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"></web-resource-collection></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><auth-constraint></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";"><role-name>*</role-name></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"></auth-constraint></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><!-- <user-data-constraint> --></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><!-- <transport-guarantee>CONFIDENTIAL</transport-guarantee> --></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><!-- </user-data-constraint> --></td></tr><tr><td style=";"><br/></td><td style=";"></security-constraint></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";"><br/></td><td style=";"><security-constraint></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><web-resource-collection></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";"><web-resource-name>Unprotected area</web-resource-name></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";"><url-pattern>/resources/*</url-pattern></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"></web-resource-collection></td></tr><tr><td style=";"><br/></td><td style=";"></security-constraint></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";"><br/></td><td style=";"><login-config></td><td style=";"><br/></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><auth-method>FORM</auth-method></td><td style=";"><br/></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><realm-name>SecuredRealm</realm-name></td><td style=";"><br/></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><form-login-config></td><td style=";"><br/></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";"><form-login-page>/jasl.jsf</form-login-page></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";"><form-error-page>/jasl.jsf</form-error-page></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"></form-login-config></td><td style=";"><br/></td></tr><tr><td style=";"><br/></td><td style=";"></login-config></td><td style=";"><br/></td></tr><tr><td style=";"><br/></td><td style=";"><security-role></td><td style=";"><br/></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><role-name>admin</role-name></td><td style=";"><br/></td></tr><tr><td style=";"><br/></td><td style=";"></security-role></td><td style=";"><br/></td></tr><tr><td style=";"><br/></td><td style=";"><security-role></td><td style=";"><br/></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><role-name>normal</role-name></td><td style=";"><br/></td></tr><tr><td style=";"><br/></td><td style=";"></security-role></td><td style=";"><br/></td></tr></tbody></table></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/728886#728886">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="https://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>