tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: JAAS authenticated user fails authorization check
Date Tue, 06 May 2008 03:16:06 GMT
Hash: SHA1


Robin Coe wrote:
| Thanks Chris, that must be it. Can't believe I missed that.
| Unfortunately, this class is part of the Catalina codebase, which makes
| it necessary to use a runtime check and invoking a GenericPrincipal
| subclass when running inside Tomcat. I don't want to include the
| Catalina jar or be dependent on running Tomcat exclusively.

I don't understand. You shouldn't have to do any of that stuff... just
extend GenericPrincipal and you should be good to go.

| I find it strange that the code works by calling
| request.isUserInRole(), when using a class that implements the Principal
| interface, but fails when using declared roles. It's annoying that the
| Tomcat docs don't mention the necessity of extending GenericPrincipal
| when rolling your own implementation.

That's because you generally don't roll your own half-implementation,
which is what you've done, here.

Tomcat expects its own implementation not to be subverted. Principal
does not have an "isInRole" method, so it's got to come from somewhere
else. Sorry!

If you want complete control over authentication and authorization, you
can check out securityfilter (,
although you may find that you have to implement a lot of your own stuff
if you really want a lot of control. You should be able to use Tomcat
realms (including JAASRealm) along with it, though.

- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message