Shaun
Shaun

Reputation: 3895

Tomcat 7 Redirect for Unauthenticated Users

I'm using form based authentication with Tomcat 7. However, on a few specific pages I would like to route an un-authenticated user to a non-secured resource INSTEAD of the login page

Something like:

secure1.html -> unsecured1.html 
secure2.html -> unsecured2.html
.*.html -> login.html  (all others, redirect normally with with my login-config)

Is this possible with Tomcat 7?

<login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
        <form-login-page>login.html</form-login-page>
        <form-error-pagelogin-error.html</form-error-page>
    </form-login-config>
</login-config>

Upvotes: 0

Views: 118

Answers (1)

Pat W
Pat W

Reputation: 36

I imagine you could use something like this http://www.tuckey.org/urlrewrite/ to get the job done. It functions similarly to mod_rewrite in apache.

Upvotes: 1

Related Questions