tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: How to log and debug Realm Authentication in 5.5.17?
Date Mon, 17 Jul 2006 20:34:25 GMT
Looks like you'll have to implement a customised JDBCSecurityRealm such as what you see here

http://www.trifork.com/package/eos/external/static/T4/doc-4.1/documentation/userdoc/html/ch32.html
overriding the important access points such as all access(es) by implementing your own override
of JDBCSecurityRealm
to (possibly your own base class) underlying principal javax.security.Principal

so when your own JDBCSecurityRealm authenticates the supplied username/password via the method
public Principal authenticate(String userName, String password)
        throws LoginException {

your catch clause for 'LoginException' would write to Log4j..

HTH,
Martin--
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "David Erickson" <halcyon@ratemod.com>
To: <users@tomcat.apache.org>
Sent: Monday, July 17, 2006 2:15 PM
Subject: How to log and debug Realm Authentication in 5.5.17?


> Hi I am running two hosts under an engine in Tomcat 5.5.17, I have one
> webapp on each host and am having some problems with authentication on both.
> Each has a jdbc realm being deployed by a context.xml file in the META-INF
> directory of the webapp.  
> 
> My question is, how can I log and debug the deployment of each realm and its
> properties, and subsequent login attempts/rejections, and their JDBC SQL
> queries etc?
> 
> I am using log4j for logging with the below basic setup, and have been
> unable to get any information:
> 
> log4j.appender.R=org.apache.log4j.RollingFileAppender 
> log4j.appender.R.File=${catalina.home}/logs/tomcat.log 
> log4j.appender.R.MaxFileSize=10MB 
> log4j.appender.R.MaxBackupIndex=10 
> log4j.appender.R.layout=org.apache.log4j.PatternLayout 
> log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n 
> 
> log4j.appender.localhost=org.apache.log4j.RollingFileAppender 
> log4j.appender.localhost.File=${catalina.home}/logs/localhost.log
> log4j.appender.localhost.MaxFileSize=10MB 
> log4j.appender.localhost.MaxBackupIndex=10 
> log4j.appender.localhost.layout=org.apache.log4j.PatternLayout 
> log4j.appender.localhost.layout.ConversionPattern=%p %t %c - %m%n 
> 
> log4j.rootLogger=ERROR, R 
> log4j.logger.org.apache=ERROR, R
> log4j.logger.org.apache.catalina.realm=DEBUG,R
> 
> log4j.logger.org.apache.[Catalina].[localhost]=DEBUG, localhost
> 
> Thanks,
> David
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.10.1/389 - Release Date: 7/14/2006
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
>
Mime
View raw message