This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

@RunAs doesn't work with MDB

 
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
 
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • 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
 
Sheriff
Posts: 10445
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
Posts: 40035
809
Eclipse IDE VI Editor Java
  • 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.
 
All that thinking. Doesn't it hurt? What do you think about this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic