Roles & authorization


EJB programming & troubleshooting: Roles & authorization

  1. Roles & authorization (4 messages)


    In EJB model is posibility to add roles, and link permission to method execution with them.

    And here is my question:
    Suppose that, a client is a simple command line program
    on a Unix platform.
    How the client can tell: "i'm in role...". Or maybe somebody else can authorize such client, but how?

    Thx for any info,

    Threaded Messages (4)

  2. Roles & authorization[ Go to top ]

    you can simply pass your user name an d password through command line or through some frame which u can develop useing awt.
  3. Roles & authorization[ Go to top ]

    sorry, if my question wasn't clear :)

    yes, i can pass it to client program...

    but how the client program can authorize itself, when it's
    calling EJB method, which required some role (on the server side you can check it calling isCallerInRole(String))

    thx for the post :)
  4. Roles & authorization[ Go to top ]

    Hi Mikolaj,

    You have to create a Properties object and store userid and passord as properties(like initial context factory) and pass the properties object to the constructor of InitialContext. This will logon to the app server ejb context.

  5. Roles & authorization[ Go to top ]

    Yes, but the spec does not cover the creation of the roles and users and how they map. That's server specific.

    You provide user and password when you authenticate to JNDI to get the initial context object (by default your apps server probably doesn't authenticate, so lets anyone in.)