Please help! SecurityFilter redirects to login page again...  
Author Message
Peet





PostPosted: 2006-6-28 18:22:00 Top

java-programmer, Please help! SecurityFilter redirects to login page again... Hi All I ha e a problem around authenticating ith Securit Filter and can t see the reasons Container is Tomcat 5 5 9 The problem is: After successful authentication response is the login page again although form default page propert is a redirect jsp for securit filter here I redirect users to the proper role s starting page If I input and send user information again the redirect orks properl Just for the second time I can t see the reasons I ha e alread used securit filter and ha en t had this error there I ha e debugged redirect jsp and could see that on the line response sendRedirect basePath admin inde jsp has run but the result is the login page again When I tr to access some resources ithin the protected area after authentication the redirect is correct The abo e described error e ists onl hen I tr to do a direct login and hope to be redirected to the form default page An idea please ? redirect jsp s running section: < @ page language= ja a import= ja a util pageEncoding= iso 8859 2 > < String path = request getConte tPath ; String basePath = request getScheme : request getSer erName : request getSer erPort path ; if request isUserInRole admin response sendRedirect basePath admin inde jsp ; S stem out println basePath admin inde jsp ; else if request isUserInRole modifier response sendRedirect basePath modifier inde jsp ; else if request isUserInRole inquirier response sendRedirect basePath inquirier inde jsp ; else response sendRedirect basePath inde jsp ; > securit filter config ml: <? ml ersion= 1 0 encoding= ISO 8859 1 ?> < DOCTYPE securit filter config PUBLIC Securit Filter org DTD Securit Filter Configuration 2 0 EN http: securit filter org dtd securit filter config_2_0 dtd > <securit filter config> < securit konfiguracio START > < admin resources START > <securit constraint> < eb resource collection> < eb resource name>Admin resources< eb resource name> <description> accessible b authenticated users of the admin role< description> <url pattern> admin < url pattern> <http method>GET< http method> <http method>POST< http method> <http method>PUT< http method> <http method>DELETE< http method> < eb resource collection> <auth constraint> <description>These roles are allo ed access< description> <role name>admin< role name> < auth constraint> < securit constraint> < admin resources END > <login config> <auth method>FORM< auth method> <realm name>lm realm< realm name> <form login config> <form login page> inde jsp< form login page> <form error page> inde jsp?badpass =Y< form error page> <form default page> redirect jsp< form default page> < form login config> < login config> <securit role> <description>admin role has access to this eb application< description> <role name>admin< role name> < securit role> <realm className= org securit filter realm catalina CatalinaRealmAdapter > <realm className= org apache catalina realm JDBCRealm > <realm param name = dri erName alue= com microsoft jdbc sqlser er SQLSer erDri er > <realm param name = connectionURL alue= jdbc:microsoft:sqlser er: 127 0 0 1:1433;DatabaseName=db_licenceman ager;User=m user;Pass ord=m pass ord;SelectMethod=cursor > <realm param name = connectionName alue= m user > <realm param name = connectionPass ord alue= m pass ord > <realm param name = userTable alue= users > <realm param name = userNameCol alue= user_name > <realm param name = userCredCol alue= pass ord > <realm param name = userRoleTable alue= user_roles > <realm param name = roleNameCol alue= role_name > < realm> < <realm className= org apache catalina realm Memor Realm > > < securit konfiguracio END > < securit filter config> eb ml: <? ml ersion= 1 0 encoding= ISO 8859 1 ?> < DOCTYPE eb app PUBLIC Sun Micros stems Inc DTD Web Application 2 3 EN http: ja a sun com dtd eb app_2_3 dtd > < eb app> < filter: securit filter konfiguracio START > <filter> <filter name>Securit Filter< filter name> <filter class>org securit filter filter Securit Filter< filter class> <init param> <param name>config< param name> <param alue> WEB INF securit filter config ml< param alue> < init param> <init param> <param name> alidate< param name> <param alue>true< param alue> < init param> < filter> < map all requests to the Securit Filter control hat it does ith configuration settings > <filter mapping> <filter name>Securit Filter< filter name> <url pattern> < url pattern> < filter mapping> < filter: securit filter konfiguracio END > <ser let> <ser let name>action< ser let name> <ser let class>org apache struts action ActionSer let< ser let class> <init param> <param name>config< param name> <param alue> WEB INF struts config ml< param alue> < init param> <init param> <param name>debug< param name> <param alue>3< param alue> < init param> <init param> <param name>detail< param name> <param alue>3< param alue> < init param> <load on startup>0< load on startup> < ser let> <ser let mapping> <ser let name>action< ser let name> <url pattern> do< url pattern> < ser let mapping> < eb app> Thanks in ad ance Peet