File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes security-identity tag for Message Driven Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "security-identity tag for Message Driven Beans " Watch "security-identity tag for Message Driven Beans " New topic

security-identity tag for Message Driven Beans

Reghu Ram Thanumalayan
Ranch Hand

Joined: Oct 21, 2003
Posts: 193
Hello friends,
I read in Mastering EJB by Ed Roman that � it is illegal for Message Driven Bean�s to perform any programmatic and declarative security� (page no: 267). Is this statement correct? Aren�t MDB�s allowed to use declarative security?
They are allowed to use the <run-as> tag in the <security-identity> section in the DD. So to use <run-as> an abstract security role has to be given in the <role-name> tag in the <security-identity> tag.
But since MDB�s don�t have any client calling them, security roles need not be defined. But to allow the bean to run as with another identity, an abstract security role needs to be defined but I guess that role will not have any mapping to a real security role in the particular application domain.
Can any one help me with a scenario in which such a case would happen where any mapping between the abstract role and the actual role is not needed?

Cheers,<br />Reghu Ram T<br /> <br />SCJP 1.4 - 98 %, SCBCD 1.3 - 94 %, SCMAD 1.0 - 92 %
Mikalai Zaikin
Ranch Hand

Joined: Jun 04, 2002
Posts: 3322
I think, Ed Roman is right.
*Declarative security* and *programmatic security* as NOT the same as *security identity*.
So, you can't check role of caller, or define security in DD for MDB.
There is NO caller, and there is no role.
But, you can define SECURITY IDENTITY for MDB, so it can represent a caller
with security role.
Cheers !!

Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam Study Guide and Quiz
Exam 1Z0-810: Upgrade to Java SE 8 Programmer Study Guide and Quiz
I agree. Here's the link:
subject: security-identity tag for Message Driven Beans
It's not a secret anymore!