473,385 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

JDBCRealms.... Ugh...

Greetings folks,

I'm trying to get JDBCRealms working presently. I want to use Tomcat's security to be able to login to this program I am writing and depending on the role of the user, only show them a specific portion of the program or allow them to edit certain info. I have looked on the net for some help on JDBCRealms but it's really far and few between. I have the tomcat documentation and I have an O'Reilly book on tomcat as well. I cannot get my hands around the realm idea. Can anyone provide some assistance?

Here is what I have in my server xml file for the realm:

<Realm className="org.apache.catalina.realm.JDBCRealm" debug="0"
driverName="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/****************"
connectionName="*********"
connectionPassword="********"
userTable="tcuser" userNameCol="tcuser_name" userCredCol="password"
userRoleTable="tcuser" roleNameCol="role_name" />

In my database I have a single table in there called tcuser which has user_name, password, and role_name fields. I don't believe that this should be a problem. is there anything that I am missing? Obviously there is, but I cannot figure it out.

Thanks in advance for any information anyone can provide.

- Regards,

Josh

Here is a snippet of the web.xml file:

<security-constraint>
<web-resource-collection>
<web-resource-name>********</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Administrator</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Training</realm-name>
<form-login-config>
<form-login-page>/Login.jsp</form-login-page>
<form-error-page>/Login.jsp</form-error-page>
</form-login-config>
</login-config>

It is telling me that the j_security_check is not available.
Jul 8 '08 #1
0 1534

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.