tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Roberts <techi...@ait-web.com>
Subject JDBCRealm first try
Date Tue, 08 Jul 2003 15:56:48 GMT
This is my first try at setting up a JDBC Realm.
I have read the how-to's and I also have the book "Mastering Tomcat 
Development" to help me figure it out but I still need help.

I am trying to use Form Based Authentication and Oracle JDBCRealm.

I get error: "No Realm has been configured to authenticate against"


My error log:

2003-07-08 11:25:32 WebappLoader[/hd]: Deploying class repositories to 
work directory /var/tomcat4/work/Standalone/localhost/hd
2003-07-08 11:25:32 WebappLoader[/hd]: Deploy class files 
/WEB-INF/classes to /var/tomcat4/webapps/hd/WEB-INF/classes
2003-07-08 11:25:32 WebappLoader[/hd]: Reloading checks are enabled for 
this Context
2003-07-08 11:25:32 ContextConfig[/hd]: WARNING: Security role name 
tomcat used in an <auth-constraint> without being defined in a 
<security-role>
2003-07-08 11:25:32 ContextConfig[/hd]: No Realm has been configured to 
authenticate against
2003-07-08 11:25:32 ContextConfig[/hd]: Marking this application 
unavailable due to previous error(s)
2003-07-08 11:25:32 StandardManager[/hd]: Seeding random number 
generator class java.security.SecureRandom
2003-07-08 11:25:32 StandardManager[/hd]: Seeding of random number 
generator has been completed
2003-07-08 11:25:32 StandardContext[/hd]: Context startup failed due to 
previous errors

-----------------------------------

I am modifying the default server.xml that installs with Tomcat 4:
I am not sure if I need the "UserDatabaseRealm".  Here it is commented out!

      <!-- This Realm uses the UserDatabase configured in the global JNDI
            resources under the key "UserDatabase".  Any edits
            that are performed against this UserDatabase are immediately
            available for use by the Realm.  -->
<!--
       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                  debug="0" resourceName="UserDatabase"/>
-->

       Realm className="org.apache.catalina.realm.JDBCRealm"
            connectionName="AI_DBA"
            connectionPassword="password"
            connectionURL="jdbc:oracle:thin:@sukoi:1521:orcl"
            driverName="oracle.jdbc.driver.OracleDriver"
            userTable="REALM_USER"
            userNameCol="LOGIN"
            userCredCol="PASSWORD"
            userRoleTable="REALM_ROLE"
            roleNameCol="ROLE"
       />

-----------------------------------------------------

My WEB-INF/web.xml file:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
     "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

<web-app>
   <security-constraint>
     <web-resource-collection>
       <web-resource-name>Protected Area</web-resource-name>
       <!-- Define the context-relative URL(s) to be protected -->
       <url-pattern>/*</url-pattern>
       <!-- Only methods listed will be protected -->
       <http-method>DELETE</http-method>
       <http-method>GET</http-method>
       <http-method>POST</http-method>
       <http-method>PUT</http-method>
     </web-resource-collection>
     <auth-constraint>
     <!-- Anyone with one of the listed roles may access this area -->
       <role-name>tomcat</role-name>
     </auth-constraint>
   </security-constraint>
   <login-config>
     <auth-method>FORM</auth-method>
     <realm-name>Form-Based Authentication Area</realm-name>
     <form-login-config>
       <form-login-page>/login.jsp</form-login-page>
       <form-error-page>/login_error.jsp</form-error-page>
     </form-login-config>
   </login-config>
</web-app>


Any help greatly appreciated.

Thanks,

-- 
*******************************************
* Rick Roberts                            *
* Advanced Information Technologies, Inc. *
*******************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message