• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to pass a securityContext onto an EJB container (JBoss)

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, evereone.

How can I get user roles in a session bean ?
isCallerInRole returns "no security context available" null-pointer
exception.

A SessionContext parameter passed in by the container to setSessionContext function does not contain this information.

Assuming I will somehow manage to get the necessary information,
where to store it so that isCallerInRole could use it ?
Does JBoss handle it for me ?

Thanks a lot for your kind help.
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If a user is authenticated through the web tier, JBoss will propagate this information to the business tier automatically.
 
Andrey Rybak
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well the user is authenticated, however no securityContext propagation occurs.

If I'm passing an entire request object as a parameter to an ejb,
then only username passes with it, not the securityContext.

So request.isUserInRole function works fine outside of an ejb but
does not inside it.

Thus I'm compelled either to query all the necessary roles outside of the ejb and pass them as additional parameters, which is silly, or pass a username as a parameter and access the user_roles table from inside, which is tedious.

There are rumors of a plugins that handle this issue in weblogic and websphere. Is there something similar in JBoss ?
reply
    Bookmark Topic Watch Topic
  • New Topic