-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
None
-
None
-
None
This bug is the same than https://issues.jboss.org/browse/UNDERTOW-348 but with the difference that the application is configured to use JAAS form based authentication
Example of web.xml to enable form based authentication
<security-constraint>
<web-resource-collection>
<web-resource-name>authenticated users</web-resource-name>
<url-pattern>index</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>roletest</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>ApplicationRealm</realm-name>
<form-login-config>
<form-login-page>/html/login.html</form-login-page>
</form-login-config>
</login-config>
The content of /html/login.html is as follow:
<form action="j_security_check" method="post"> <input type="text" placeholder="Username" name="j_username"> <input type="password" placeholder="Password" name="j_password"> <input type="submit"> </form>
Given a request to / and a welcome file set to /index
After the login, JBossWeb wil return "/" when HttpServletRequest#getRequestURI is called,
and "/index" when HttpServletRequest#getServletPath is called.
Undertow will return "/index" in both cases.
Example:
With a welcome file declaration in web.xml as follows:
<welcome-file-list>
<welcome-file>index</welcome-file>
</welcome-file-list>
and when requesting the context root of an application (e.g. http://localhost:8080 for a root deployment), after the login the results are as follows:
| getRequestURI | getServletPath | |
|---|---|---|
| Tomcat/JBossWeb | / | /welcome |
| Undertow | /welcome | /welcome |