About Question enthuware.oce-ejbd.v6.2.562 :

Moderator: admin

Post Reply
goetz

About Question enthuware.oce-ejbd.v6.2.562 :

Post by goetz »

The explanation for the last option seems off. It basically says the call

Code: Select all

MessageDrivenContext.isCallerInRole()
invoked in onMessage() will return values per the "run-as" configuration of the bean. However, the way I understand it, isCallerInRole will only reflect the run-as identity from method calls made from onMessage(), not in onMessage() itself. Thus within onMessage(), isCallerInRole always returns false as there is no security context, but from within methods called by onMessage, isCallerInRole will reflect the run-as config on the MDB.

admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.562 :

Post by admin »

I believe if the value of isCallerInRole and getCallerPrincipal is returned as per "run as" in the methods called by the bean, the same value will be returned in the bean as well because the MDB is running as "run as".
If it were not so, the specification would either disallow calling isCallerInRole and getCallerPrincipal in the MDB code, but as per Table 4, these calls are permitted.

HTH,
Paul.

gurpreet_asrgndu
Posts: 55
Joined: Thu Jan 03, 2013 7:51 am
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.562 :

Post by gurpreet_asrgndu »

yes the identity/role-name specified in RunAs annotation will be returned from method calls from onMessage() method. in my opinion calling getCallerPrincipal from inside onMessage method will result in printing unauthenticated identity used by the ejb container. i also checked and in glassfish 3.1.2.2 it pritns anonymous.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests