users@glassfish.java.net

How to define a principal (security) accessible in the EJB module ?

From: <glassfish_at_javadesktop.org>
Date: Fri, 16 May 2008 12:24:42 PDT

Hi everybody,

I have to implement an auditing feature in my application. It is running on Glassfish V2 very well !! Basically, the system has to record each modification in the database and associate each modification with a user and a date.

The problem is that I don't have the user name to associate with auditing records. I can't modify the existent interfaces to send the authenticated user. I know that I can get it using:

@Resource EJBContext ctx;
...
Principal p = ctx.getCallerPrincipal();

but I don't know how to set this principal from the web client, which make part of the same enterprise application. What can I do to address this small issue?

All the best!

Hildeberto
[Message sent by forum member 'hbeto' (hbeto)]

http://forums.java.net/jive/thread.jspa?messageID=274909