Hi,
I'm trying to track down an odd Realm authentication problem, but I can't seem to get anything to show up in any of the logs. My application (henceforth referred to as "myapp") deploys successfully via war file with the manager application. When I try to access those portions of the application under security constraints, I am presented with an HTTP BASIC authentication dialog. However, the dialog keeps popping up, even though I "know" I'm using the correct username and password. I "know" this, because I've compared the SHA digest in the database against one generated from the password. Take that for what it's worth... ;-)
What's really bugging me is that _NOTHING_ gets logged as to why the authentication failed. One interesting thing I'm seeing, is that even though I've defined a <Logger> in my <Context> (see below), this log file isn't showing up. I get "catalina.out" and "localhost_log.date.txt," but nothing else. In localhost_log, I do see this line, so I have to assume that something is happening:
2005-01-12 16:35:00 ContextConfig[/myapp]: Configured an authenticator for method BASIC
Any help on this would be greatly appreciated, as I'm about out of ideas.
Versions:
---------------
Tomcat: 4.1.31
Red Hat 9.0 (yes, I have this as part of the TC start: export LD_ASSUME_KERNEL=2.4.1)
Sun JVM: 1.5
I have made the following additions to server.xml for my two JDBC datasources:
------------------------------------------------------------------------------------------------
<Resource name="jdbc/db_devel" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/db_devel">
...
(Yes, this information is correct. It has been tested and double-checked.)
</ResourceParams>
<Resource name="jdbc/db_stats" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/db_stats">
...
(Yes, this information is correct)
</ResourceParams>
------------------------------------------------------------------------------------------------
My application's context.xml file: ----------------------------------------------------- <Context debug="4" reloadable="false" swallowOutput="true" crossContext="false">
<Logger
verbosity="4"
className="org.apache.catalina.logger.FileLogger"
prefix="pcs_log."
suffix=".txt"
timestamp="true"
/>
<!-- Naming indirection, to let application use generalized names for lookup. -->
<ResourceLink name="db_default" global="jdbc/db_devel" type="javax.sql.DataSource"/>
<ResourceLink name="db_stats" global="jdbc/db_stats" type="javax.sql.DataSource"/>
<Realm resourceName="Application Secure Realm" className="org.apache.catalina.realm.DataSourceRealm" dataSourceName="jdbc/db_devel" userTable="employee" userNameCol="login" userCredCol="password" userRoleTable="employee" roleNameCol="role" digest="SHA" /> </Context>
Interesting bits from my applicaton's web.xml: ---------------------------------------------- <resource-ref> <description>DB Connection</description> <res-ref-name>db_default</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> <resource-ref> <description>DB Connection for statistics only</description> <res-ref-name>db_stats</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> ... <security-constraint> <web-resource-collection> <web-resource-name>Admin</web-resource-name> <url-pattern>/admin/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>super</role-name> <role-name>administrator</role-name> </auth-constraint> </security-constraint> ... <login-config> <auth-method>BASIC</auth-method> <realm-name>Application Secure Realm</realm-name> </login-config> ... <security-role> <role-name>super</role-name> </security-role> <security-role> <role-name>administrator</role-name> </security-role> <security-role> <role-name>user</role-name> </security-role> <security-role> <role-name>stats</role-name> </security-role> ----------------------------------------------
Does anyone have any ideas, or perhaps see something obvious that I'm missing?
Thanks,
Peter Moore
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]