I have a j2ee web app that is using JAAS form based authentication. However, due to some unusual requirements, I cannot have the user enter their username and password directly into the logon.jsp form and have them submit it. Instead, I must gather the data on a separate page, and then later redirect to logon.jsp to log them in.
What I am thinking of doing is storing the username/password unencrypted in the HTTPSession. When I am ready to authenticate, I use a response.redirect to route to logon.jsp. In logon.jsp, I take the username and password out of the Session, populate the standard 'j-security-check' form, and then use javascript to submit the form.
How much of a security hole is this? I'm uncomfortable routing the request to go to logon.jsp via the browser (thats what a redirect does) because someone might get access to the session, and therefore the unencrypted password. If I am using HTTPS / SSL, is this a likely situation? How would it be exploited?
I looked into invoking the login servlet directly in a JSP without using the form, but that doesn't seem to be a viable option, particularly because I lose my insulation from differing J2EE containers/application servers.
Anyone got any idea how I can limit this security hole? Would using forward as opposed to redirect be better, because it doesnt go back to the browser?
How bad is this?