[richfaces-issues] [JBoss JIRA] (RF-11309) form authentication broken

Jan Papousek (Issue Comment Edited) (JIRA) jira-events at lists.jboss.org
Wed Nov 23 08:57:40 EST 2011


    [ https://issues.jboss.org/browse/RF-11309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645116#comment-12645116 ] 

Jan Papousek edited comment on RF-11309 at 11/23/11 8:56 AM:
-------------------------------------------------------------

When I change servlet mapping in web.xml file, it works correctly on JBoss AS 7.0.2:
{code}
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
		  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
 
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
<!--         <url-pattern>*.xhtml</url-pattern> -->
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
<!--         <welcome-file>home.xhtml</welcome-file> -->
        <welcome-file>faces/home.xhtml</welcome-file>
    </welcome-file-list>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Secure</web-resource-name>
            <url-pattern>*.xhtml</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>JBossAdmin</role-name>
        </auth-constraint>
    </security-constraint>

    <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>JBoss JMX Console</realm-name>
        <form-login-config>
<!--             <form-login-page>/login.xhtml</form-login-page>     -->
            <form-login-page>/faces/login.xhtml</form-login-page>
<!--             <form-error-page>/loginError.xhtml</form-error-page> -->
            <form-error-page>/faces/loginError.xhtml</form-error-page>
        </form-login-config>
    </login-config>

    <security-role>
        <role-name>JBossAdmin</role-name>
    </security-role>
</web-app>
{code}

See jsf2demo-updated-mapping.zip file in attachments.

EDIT: Don't be confused from images in test application. I've added pictures to the welcome and login page to see whether mapping works correctly.
                
      was (Author: jpapouse):
    When I change servlet mapping in web.xml file, it works correctly on JBoss AS 7.0.2:
{code}
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
		  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
 
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
<!--         <url-pattern>*.xhtml</url-pattern> -->
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
<!--         <welcome-file>home.xhtml</welcome-file> -->
        <welcome-file>faces/home.xhtml</welcome-file>
    </welcome-file-list>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Secure</web-resource-name>
            <url-pattern>*.xhtml</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>JBossAdmin</role-name>
        </auth-constraint>
    </security-constraint>

    <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>JBoss JMX Console</realm-name>
        <form-login-config>
<!--             <form-login-page>/login.xhtml</form-login-page>     -->
            <form-login-page>/faces/login.xhtml</form-login-page>
<!--             <form-error-page>/loginError.xhtml</form-error-page> -->
            <form-error-page>/faces/loginError.xhtml</form-error-page>
        </form-login-config>
    </login-config>

    <security-role>
        <role-name>JBossAdmin</role-name>
    </security-role>
</web-app>
{code}

See jsf2demo-updated-mapping.zip file in attachments.


                  
> form authentication broken
> --------------------------
>
>                 Key: RF-11309
>                 URL: https://issues.jboss.org/browse/RF-11309
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: core
>    Affects Versions: 4.0.0.Final
>         Environment: jboss-6.0.0.Final, richfaces-4.0.0.Final, Firefox 4 & 5
>            Reporter: Radim Hanus
>            Assignee: Brian Leathem
>         Attachments: jsf2demo-original.zip, jsf2demo-updated-mapping.zip
>
>
> described in forum thread in a great detail, simple war to reproduce enclosed as well
> *steps to deploy the test application to JBoss AS 7.0.2* (from forum)
> # download and extract jsf2demo.zip (see attachments)
> # package contained maven project
> # add a security domain into standalone.xml:
> {code}
> <security-domain name="jmx-console">
>      <authentication>
>           <login-module code="UsersRoles" flag="required">
>                <module-option name="usersProperties" value="${jboss.server.config.dir}/jmx-console-users.properties"/>
>                <module-option name="rolesProperties" value="${jboss.server.config.dir}/jmx-console-roles.properties"/>
>           </login-module>
>      </authentication>
> </security-domain>
> {code}
> # copy both *jmx-console-users.properties* and *jmx-console-roles.properties* from jboss-6.0.0.Final/server/default/conf/props to jboss7/standalone/configuration
> # deplot packaged WAR file

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list