• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Call from MDB to SSB is always anonymous in JBoss AS7/EAP6

 
Qu Vad
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got problem with JBoss AS7 / EAP6. In MDB, when I lookup for SSB and call its method, the call is always anonymous, i.e. sessionContext.getCallerPrincipal() returns Principal(anonymous). Always... In AS5 everything was fine.

How can I fix it to make a call with an authenticated user?

My MDB:

My queue settings:

My Security Domain:
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MDB don't have a client and hence don't run in a specific security context. If you want to invoke the SLSB from the MDB, in a security context, you can use the @RunAs annotation on the MDB and specify the role that you want to run as.
 
Qu Vad
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikiran Pai, thanks for the quick answer!

I receive a username in Message object in MDB. And I would like to call SSB by that user... Is there a way to create a security context for particular user in MDB.onMessage()?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's answered here https://community.jboss.org/message/827894#827894. Instead of the deployment descriptor, you can even use JBoss specific @org.jboss.ejb3.annotation.RunAsPrincipal annotation to specify a principal to be used when you do an outgoing EJB invocation from a MDB.

 
Qu Vad
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for assistance! Solved by doing JAAS login in MDB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic