Page 1 of 1
About Question enthuware.oce-ejbd.v6.2.562 :
Posted: Sun Jan 15, 2012 9:50 am
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.
Re: About Question enthuware.oce-ejbd.v6.2.562 :
Posted: Mon Jan 16, 2012 9:01 am
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.
Re: About Question enthuware.oce-ejbd.v6.2.562 :
Posted: Mon Jul 15, 2013 1:33 pm
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.