• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@RunAs doesn't work with MDB

 
Stefan Müller
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a message drive bean which I annotated with @RunAs("SYSTEM"). In the onMessage method I'm checking now the subject like this:



and also like this:



Both of them are null.

1. I expected that due to the RunAs, I'd get some subject with a "SYSTEM" principal.
2. I don't understand what's the difference between the two pieces of code, getting the subject. In some other cases, one is null, the other isn't. Which one is the correct to use?
3. Is there a great book, explaining the security internals? Everything I found was rather sketchy, I need to know some more details about how things work togeter (loginmodule, interceptor, identities, principals) cause I need to implement some custom security features


Best regards,
Stefan
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34229
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stefan,
The second character of your last name displays as a "?" on my machine. Just curious - is it an ASCII character? If not, what language does it belong to?
 
Stefan Müller
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,

it's a german umlaut-U (Ü) which apparently is not displayed correctly here :-)



http://en.wikipedia.org/wiki/Germanic_umlaut
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a message drive bean which I annotated with @RunAs("SYSTEM"). In the onMessage method I'm checking now the subject ...



http://www.j2ee.me/javaee/5/docs/api/javax/ejb/EJBContext.html#getCallerPrincipal()
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34229
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stefan M�ller wrote:it's a german umlaut-U (Ü) which apparently is not displayed correctly here :-)

Thanks. I was not aware of that. It did work at one point. I see it in the release notes. And a thread in the moderators forum where some European moderators validated it. I'll add it to our bug list.
 
Stefan Müller
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Results in Exception: No valid security context for the caller identity

The additional issue is, that I want to be able to read the Principal in an interceptor of a method which is called by the MDB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic