I am following the
Tomcat forms based authentication and I it is working for me through an external PreLogin.jsp page I have.
PreLogin.jsp:
<html>
<head><title>Please Log In</title>
<body>
<form method="POST" action='<%= response.encodeURL("j_security_check") %>' >
<table border="0" cellspacing="5">
<tr>
<th align="right">Username:</th>
<td align="left"><input type="text" name="j_username"></td>
</tr>
<tr>
<th align="right">Password:</th>
<td align="left"><input type="password" name="j_password"></td>
</tr>
<tr>
<td align="right"><input type="submit" value="Log In"></td>
<td align="left"><input type="reset"></td>
</tr>
</table>
</form>
</body>
</html>
changes to web.xml:
...
...
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Worldwide Express</realm-name>
<form-login-config>
<form-login-page>/PreLogin.jsp</form-login-page>
<form-error-page>/LoginErr.jsp</form-error-page>
</form-login-config>
</login-config>
...
...
What is not working for me: I want to be able to have an external page outside of my applications context where I can take the login info (username and password) and using that login to tomcat. Can anyone please tell me if this is possible?
Thanks in advance.