Bug 5981 - subclasses of org.globus.gsi.jaas.SimplePrincipal
: subclasses of org.globus.gsi.jaas.SimplePrincipal
Status: NEW
: CoG jglobus
other
: 1.4
: All All
: P3 normal
: ---
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-04-03 17:57 by
Modified: 2008-04-06 12:58 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-04-03 17:57:03
Class org.globus.gsi.jaas.SimplePrincipal implements an equals method but that
method fails to distinguish instances of SimplePrincipal from instances of
other implementations of java.security.Principal.  Moreover, the subclasses
GlobusPrincipal and UserNamePrincipal do not override the equals method, and so
they too are indistinguishable from other implementations.

Stated differently, we require that a GlobusPrincipal can only be equal to
another GlobusPrincipal.  Likewise a UserNamePrincipal can only be equal to
another UserNamePrincipal.

The problem worsens if I extend SimplePrincipal:

public class SAMLPrincipal extends SimplePrincipal;

An instance of SAMLPrincipal with the same name as an instance of
UserNamePrincipal (which is likely) can not co-exist in the same JAAS Subject,
for example.

A possible solution is to make SimplePrincipal abstract, which forces
subclasses to implement a proper equals method.
------- Comment #1 From 2008-04-06 12:58:54 -------
A workaround (for us) is to extend class org.globus.gsi.jaas.UserNamePrincipal.
See Bug 5980 for details.