Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the purpose to annotation a MDB with @RunAs?

 
Himai Minh
Ranch Hand
Posts: 1398
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As mentioned in Enthuware, an MDB can be annotated with @RunAs and MessageDrivenContext.isCallerPrincipal can be used in onMessage() or timeout method or life cycle callback methods of MDB.
But MDB does not interact with any client.
What is the purpose to authorize a role to access a MDB?
 
Mikalai Zaikin
Ranch Hand
Posts: 3381
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bcause MDB may execute other EJBs and since MDB does not have any security identity, this is mechanism to run other EJBs under specific user identity.

Please, read about security identity propogation
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!