[opencms-dev] JDBC Realm for OpenCms

Corbey, Clayton CorbeyC at brandonrha.mb.ca
Mon Jul 10 22:50:22 CEST 2006


I am having trouble setting up a secure area on my website using the
JDBC realm for tomcat.

Here's my code for web.xml

<security-constraint>
     <web-resource-collection>
        <web-resource-name>BRHA Secure Web</web-resource-name>
        <url-pattern>/en/secure/*</url-pattern>
        <http-method>POST</http-method>
      </web-resource-collection>
      <auth-constraint>
           <role-name>eCatalog</role-name>
       </auth-constraint>
</security-constraint>
<login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>eCatalog</realm-name>
</login-config>
<security-role>
  <description>eCatalog</description>
  <role-name>eCatalog</role-name>
</security-role>

And here's the code in conf/server.xml

<Realm className="org.apache.catalina.realm.JDBCRealm" name="tomcat"
debug="0" driverName="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://MySqlServer:3306/tomcat?user=myUser&pass
word=myPassword" digest="MD5" userTable="users" userNameCol="user_name"
userCredCol="user_pass" userRoleTable="user_roles"
roleNameCol="role_name"/>

No login box occurs, I've even tried the FORMS auth-method with no luck.
It just let's me into the secure area, no prob.

Th realm works for the tomcat manager, so it's not the DB connection,
perhaps the config in web.xml?

OpenCms 6.2.1
Tomcat 5.5.17
MySql 5.0.22

-Clayton



More information about the opencms-dev mailing list