-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Giulio,
On 2/20/13 8:58 AM, Giulio Quaresima wrote: > I have a little [question] about the default Realm implementations > which comes with Tomcat. In particular, I refer to JAASRealm. > > I developed a JAAS LoginModule which populate the Subject with a > user principal called MyUserPrincipal. This Principal > implementation expose some information which are useful to > recognize the user (myUserCode in this example). JAASRealm > incapsulate my principal in a GenericPrincipal instance, which in > turn refers to my principal through the getUserPrincipal() method. Why are you using GenericPrincipal at all? > The problem is that, respecting the low-copuling principle, I don't > want to expose the Container API (catalina) to my webapps, because > I want my webapps virtually deployable in any environment, without > any modification. That sounds like a reasonable goal. > public class MyUserPrincipal implements Principal { private String > name; private int myUserCode; public static MyUserPrincipal > getInstance(Principal principal) { if (principal instanceof > GenericPrincipal) Why do you have any of this at all? You should just have the "implements Principal" in your class and that should be it. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEAREIAAYFAlElOkIACgkQ9CaO5/Lv0PDEkgCfXvtKu35C51P5KZnkaS/F/Fs3 NlcAn1JN0DwbnE65So2w7ZeSRRFQnYCe =sV0v -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org