Thanks for replying. Here's my 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/dtd/web-app_2_3.dtd"> <web-app> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <security-constraint> <display-name>Example Security Constraint</display-name> <web-resource-collection> <web-resource-name>Protected Area</web-resource-name> <url-pattern>/*</url-pattern> <http-method>GET</http-method> <http-method>POST</http-method> </web-resource-collection> <auth-constraint> <role-name>lduser</role-name> </auth-constraint> </security-constraint> <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/login.jsp</form-login-page> <form-error-page>/error.jsp</form-error-page> </form-login-config> </login-config> <security-role> <role-name>lduser</role-name> </security-role> </web-app> >>> [EMAIL PROTECTED] 02/15/05 11:21AM >>> Hi, How are you defining the <security-constraint> <security-role> in your ldsecure/WEB-INF/web.xml ? And also how do use this in your servlet or jsp to get authentication? Maybe post your web.xml too? aka_sergio --- Curtis Nelson <[EMAIL PROTECTED]> wrote: > I know the database connection works, because if I > include the realm as part of the engine or host, > then I can login correctly. As far as reading the > realm how-to, I've done that several times. The > second .xml file I sent you is named ldsecure.xml > (part of the ldsecure webapp), and I placed it in > $CATALINA_HOME/conf/[enginename]/[hostname]/ldsecure.xml. > I'm not creating a WAR file, just a directory > structure. > > Any additional ideas? > > > >>> [EMAIL PROTECTED] 02/15/05 > 10:43AM >>> > Check your configuration with > http://jakarta.apache.org/tomcat/tomcat-5.0-doc/realm-howto.html#JDBCRealm > > (database configuration, driver, url access, user et > password access, and > log files). > Try to setup Memory realm. > Try to validate database url connection with simple > java class. > > import java.sql.*; > import <your driver>; > > class JDBCVersion > { > public static void main (String args []) > throws SQLException > { > // Load the JDBC driver > DriverManager.registerDriver(new > com.microsoft.jdbc.sqlserver.SQLServerDriver()); > > // Something like this (probably) > Connection conn = > DriverManager.getConnection("jdbc:microsoft:sqlserver://LDSERVER:1433;databa > sename=ldbugtracker", "abc","abc"); > > // Create Oracle DatabaseMetaData object > DatabaseMetaData meta = conn.getMetaData (); > > // get driver info: > System.out.println("JDBC driver version is " + > meta.getDriverVersion()); > } > } > > > I assume that you have deployed your context > configuration in : > - META-INF/context.xml directory of your WAR file > - $CATALINA_HOME/conf/[enginename]/[hostname]/ > directory > > > -----Message d'origine----- > De : Curtis Nelson [mailto:[EMAIL PROTECTED] > Envoy�: mardi 15 f�rier 2005 18:14 > �: tomcat-user@jakarta.apache.org > Objet : Re: RE : RE : RE : RE : Tomcat configuration > > According to the tomcat docs, the preferred method > of describing a context > realm is to place it in it's own xml file. > Here's what I have: > > <!-- <Context > docBase="${catalina.home}/server/webapps/manager" > privileged="true" > antiResourceLocking="false" > antiJARLocking="false"> --> > > <Context reloadable="true" path="/ldsecure" > docbase="${catalina.home}/server/webapps/ldsecure"> > <Realm > className="org.apache.catalina.realm.JDBCRealm" > > driverName="com.microsoft.jdbc.sqlserver.SQLServerDriver" > > connectionURL="jdbc:microsoft:sqlserver://LDSERVER:1433;databasename=ldbugtr > acker;selectmethod=cursor" > connectionName="abc" connectionPassword="abc" > userTable="LDUsers" > userNameCol="username" userCredCol="password" > userRoleTable="LDUserRoles" roleNameCol="role" > debug="99"/> > </Context> > > > If I place this <context> statement in the > server.xml file, under the > described host, I get the same problem. > > Curtis > > > > >>> [EMAIL PROTECTED] 02/15/05 > 10:09AM >>> > There is no realm describe into it! > Have you declared your realm in your > META-INF/context.xml directory of your > WAR file? > Could you send us your context.xml file? > > -----Message d'origine----- > De : Curtis Nelson [mailto:[EMAIL PROTECTED] > Envoy�: mardi 15 f�rier 2005 18:03 > �: tomcat-user@jakarta.apache.org > Objet : Re: RE : RE : RE : Tomcat configuration > > With pleasure. > > <Server port="8005" shutdown="SHUTDOWN"> > <Listener > className="org.apache.catalina.mbeans.ServerLifecycleListener" > /> > <Listener > className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" > /> > > <GlobalNamingResources> > <Environment name="simpleValue" > type="java.lang.Integer" value="30"/> > > <Resource name="UserDatabase" auth="Container" > > type="org.apache.catalina.UserDatabase" > description="User database that can be > updated and saved" > > factory="org.apache.catalina.users.MemoryUserDatabaseFactory" > pathname="conf/tomcat-users.xml" /> > > </GlobalNamingResources> > > > <Service name="Catalina"> > <Connector port="8080" maxThreads="150" > minSpareThreads="25" > maxSpareThreads="75" > enableLookups="false" > redirectPort="8443" acceptCount="100" > connectionTimeout="20000" > disableUploadTimeout="true" /> > <Connector port="8009" enableLookups="false" > redirectPort="8443" > protocol="AJP/1.3" /> > > <!-- Define the top level container in our > container hierarchy --> > <Engine name="Catalina" defaultHost="localhost"> > > <Host name="localhost" appBase="webapps" > unpackWARs="true" > autoDeploy="true" > xmlValidation="false" xmlNamespaceAware="false"> > </Host> > > </Engine> > > </Service> > > </Server> > > > > Thanks for you help. > > > >>> [EMAIL PROTECTED] > De : Curtis Nelso 02/15/05 > 09:51AM >>> > JAASRealm is not a default! > Could you send us your server.xml? > > -----Message d'origine----- > De : Curtis Nelson [mailto:[EMAIL PROTECTED] > Envoy�: mardi 15 f�rier 2005 17:43 > �: tomcat-user@jakarta.apache.org > Objet : Re: RE : RE : Tomcat configuration > > How can I configure Tomcat to not use JAASRealm? > Like I said earlier, if my > JDBCRealm is associated with the <engine> or <host> > element of server.xml, > the login forms work. It's only when I move it into > it's own .xml file or > add it as part of the <context> element that I run > into problems. Does > doing that automatically require JAASRealm? > > Thanks > > >>> [EMAIL PROTECTED] 02/15/05 > 09:39AM >>> > If I look at this log, it seems that you are using > JAAS Realm ! > === message truncated === __________________________________ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]