You would have to create your own implemention of org.jboss.security.RealmMapping
and install that as the role-mapping-manager. The RealmMapping instance is what
determines the instance of Principal that is returned by getCallerPrincipal(). You
can't
rely on the type of Principal that is established by your LoginModule to be what is
returned by the getCallerPrincipal() method as the container can choose to insert a
proxy that only publishes the java.security.Principal interface to prevent changes to
the
Principal established by the LoginModule.
The org.jboss.security.RealmMapping#getPrincipal( Principal ) method is where you
would map the java.security.Principal into your particular instance.
----- Original Message -----
From: "Cor Hofman" <[EMAIL PROTECTED]>
To: "JBoss User list" <[EMAIL PROTECTED]>
Sent: Friday, February 23, 2001 11:18 PM
Subject: [jBoss-User] Problems with Principal class propagation
> Hi,
>
> I implemented my own Principal class to add some extra
> authorization methods.
>
> When I perform a the login and call a session bean everything looks fine.
> The getCallerPrincipal() inside a sessionbean returns
> my own Principal. This session bean then calls an entity bean.
> When the entity bean call getCallerPrinciple() it returns an original
> SimplePrincipal instance. I would expect the entity bean to return
> my own Principal as well. Why isn't that happening?
> I expected the new Principal class to be propagated automatically.
>
> I use a PRE2.1 build from the beginning of january.
>
> For both the session bean and the entity bean I added the famous
> two lines:
>
> <role-mapping-manager>java:/jaas/companion</role-mapping-manager>
> <authentication-module>java:/jaas/companion</authentication-module>
>
> to the container types I use for the session and the entity bean
> (in standardJboss.xml).
>
> I also modified the auth.conf to contain a companion section.
>
> companion {
> org.companion.security.ServerLoginModule required;
> };
>
> Furthermore I added this to the client auth.conf
>
> companion
> {
> org.companion.security.ClientLoginModule required multi-threaded="true";
> };
>
> Any suggestion or hint on how to tackle this one are ver much appreciated.
>
> Greetings,
>
> Cor Hofman
>
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> List Help?: [EMAIL PROTECTED]
>
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]