Well, I'm not 100% sure about this as I've not proven all of it, but
what I believe is happening from the various Tomcat docs I've read is:
1) My custom realm's authenticate() method(s) are invoked and these
instantiate and return the custom principal objects (this bit is
proven). If I do (principalAboutToBeReturned instanceof
I_TestPrincipal) before I return from the authenticate() method then
True is returned. I believe that this is happening within the
context of the main Catalina classloader (but I've not proven this).
2) When my servlet/JSP is instantiated and invoked, if I do
(request.getUserPrincipal() instanceof I_TestPrincipal) then False is
returned (this bit is proven). I believe that this is happening
within the context of a classloader other than the main Catalina one
(but I've not proven this).
So, it would totally make sense that the problem is due to different
classloaders, but I thought that making my custom principal implement
an interface which resides in (and only in) a JAR in common/lib (as
per suggestion three in the WIKI http://wiki.apache.org/tomcat/
HowTo#head-cb66e750a22dea34b56f508dd675ed3c2e2e221a) was the way of
getting around this problem.
Cheers
Darren
On 21 Sep 2006, at 15:03, Peter Crowther wrote:
From: Darren Clarke [mailto:[EMAIL PROTECTED]
request.getUserPrincipal().getClass().toString() returns
"poc.security.TestPrincipal"
(request.getUserPrincipal() instanceof
poc.security.I_TestPrincipal returns false
Ah. Are you loading everything through the same classloader, or is
there the potential for the request's user principal to be loaded
through one classloader and your poc.security.I_TestPrincipal to be
loaded through another?
- Peter
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]