[prev in list] [next in list] [prev in thread] [next in thread]
List: tomcat-user
Subject: RE: How to get Roles in a Principal with JNDIRealm
From: "Robert Harper" <robert () iat-cti ! com>
Date: 2004-06-30 13:56:05
Message-ID: 00b301c45ea9$fcd814c0$297ba8c0 () RD ! IATCTI ! COM
[Download RAW message or body]
It may be easier to use JMX and retrieve the role out of the user information
from the user bean.
Robert S. Harper
801.265.8800 ex. 255
> -----Original Message-----
> From: Renato Primavera [mailto:renato.primavera@ionicsoft.com]
> Sent: Wednesday, June 30, 2004 7:47 AM
> To: tomcat-user@jakarta.apache.org
> Subject: How to get Roles in a Principal with JNDIRealm
>
> Hello All,
>
>
> I'm using JNDIRealm to authenticate users and it's working well.
> In my java code, I need to retrieve roles associated with the
> authenticated user.
> Here is a sample of this code :
>
> Subject s =
> Subject.getSubject((AccessControlContext)System.getSecurityManager().getSecuri
> tyContext());
> Principal p = (Principal)s.getPrincipals().toArray()[0];
>
> The API only allows me to retrieve, on the Principal, the name (with the
> getName accessor) of the user, not associated roles.
> Nevertheless, when running the code in a debugger, the state of the
> Principal object seems containing all needed informations (name,
> password, realm, roles).
>
> Is there a (standard) way to retrieve these additional information ?
> Or should I develop my own LDAP Realm (JAAS module) and extend the
> Principal interface to add role notions ?
>
> Any help would be appreciated...
>
> RP
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic