Hi All,
I am having a problem with the securityfilter when deploying using Web Tools
Platform in Eclipse. Does anyone know of any issues when using the security
filter with Eclipse, specifically with the Web tools platform?. I have read
the following
http://wiki.eclipse.org/WTP_Tomcat_FAQ.
Note that when launching a server with the WTP, a new instance of the server
is created under a new cataline.base. This may be causing the problem?
I am running the following
Eclipse Ganymede V3.4.1
Web Tools : 1.1.20x Tomcat 4.1
JSDK 1.6
I have added the project to the server with no problems and can execute/step
through servlets on the server. If I disable the security filter by
commenting
it out of web.xml the site functions the same as a non Eclipse deploy.
However, if I include the security config, it does not appear to be
functioning and I cannot log into my site when running/debugging within
Eclipse.
The security filter is set up in web.xml as follows : <filter>
<filter-name>Security Filter</filter-name>
<filter-class>org.securityfilter.filter.SecurityFilter</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/securityfilter-config.xml</param-value>
<description>Configuration file location (this is the default
value)</description>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
<description>Validate config file if set to true</description>
</init-param>
<init-param>
<param-name>loginSubmitPattern</param-name>
<param-value>/sflogin</param-value>
<description>This is the action used by the login form (in place of the
standard "j_security_check")</description>
</init-param>
</filter> <!-- map all requests to the SecurityFilter, control what it does
with configuration settings -->
<filter-mapping>
<filter-name>Security Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <security-role>
<role-name>administrator</role-name>
</security-role>
<security-role>
<role-name>user</role-name>
</security-role>
The security filter config file is as follows :
<securityfilter-config>
<security-constraint>
<display-name>The Customer area of the XXX web site.</display-name>
<web-resource-collection>
<web-resource-name>UserArea</web-resource-name>
<url-pattern>/servUserArea</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>administrator</role-name>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<display-name>Administration of the XX Web site.</display-name>
<web-resource-collection>
<web-resource-name>AdminArea</web-resource-name>
<url-pattern>/servAdminArea</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>administrator</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/servPublicArea?view=login</form-login-page>
<form-error-page>/servPublicArea?view=loginerror</form-error-page>
<form-default-page>/servUserArea?view=usermain</form-default-page>
</form-login-config>
</login-config>
<!-- start with a Catalina realm adapter to wrap the Catalina realm defined
below -->
<realm className="org.securityfilter.realm.catalina.CatalinaRealmAdapter" />
<realm className="org.apache.catalina.realm.JDBCRealm">
<realm-param name="connectionName" value="client"/>
<realm-param name="connectionPassword" value="XXX"/>
<realm-param name="connectionURL" value="XXX"/>
<realm-param name="driverName" value="oracle.jdbc.driver.OracleDriver"/>
<realm-param name="userCredCol" value="password"/>
<realm-param name="userNameCol" value="username"/>
<realm-param name="userTable" value="auth_users"/>
<realm-param name="roleNameCol" value="role_name"/>
<realm-param name="userRoleTable" value="tomcat_roles"/>
<realm-param name="debug" value="1"/>
</realm>
</securityfilter-config>
The site works fine when I set it up on a normal Tomcat installation (ie
without Eclipse/WTP) so I know there is no problem connecting to the
database realm.
I am wondering if anyone can point me in the right direction here. Any
suggestions would be helpful.
Many thanks in advance,
Jonathan.
|