session time-out and password security

Hi,

I have a webservice utility, deployed on several platforms (as an EAR on weblogic and webspere, as a WAR on tomcat), they all exhibit the same feature: on first connection, a username/password box pops up, but after the session times out (after 20 minutes or so of inactivity) and the it receives a new page request, instead of re-asking for the username/password, the app just jumps back to its own start page, and then continues without asking.

How can I make it to pop-up the username/password box again?

The security is implemented through the web.xml file:

<security-constraint>

<web-resource-collection>

<web-resource-name>Success</web-resource-name>

<url-pattern>/Logparser</url-pattern>

<http-method>GET</http-method>

<http-method>POST</http-method>

</web-resource-collection>

<auth-constraint>

<role-name>webuser</role-name>

</auth-constraint>

</security-constraint>

<login-config>

<auth-method>BASIC</auth-method>

<realm-name>default</realm-name>

</login-config>

<security-role>

<role-name>webuser</role-name>

</security-role>

I found that this in itself was not good enough security as you would be able to go directly to one of the sub-pages (if you know the url), and to prevent that I pass (and check) the session-id with each page request.

(all java servlets).

Obviously something is missing, but I don't know what

thanks

Michael

[1682 byte] By [mljmeermana] at [2007-11-26 21:52:01]
# 1

Hi Michael,

Your web application is currently configured to use BASIC authentication.

Instead if you use FORM-based authentication, then any new request (after your web application session times out) will be redirected to the login page. The Servlet specification has more information about FORM-based login.

If you have a Sun ONE Web Server 6.1 or a Sun Java System Web Server 7.0 installation you can find a sample that uses form-login in the following directory

6.1: <install-directory>/plugins/java/samples/webapps/security/form-auth

7.0: <install-directory>/samples/java/webapps/security/form-auth

Arvind_Srinivasana at 2007-7-10 3:45:40 > top of Java-index,Web & Directory Servers,Web Servers...