Reputation: 21
In my Java EE 6 application (Weblogic 12c, EJB 3.1, JSF 2) I need to know in EJB who called the method.
But the caller's login obtained from context.getCallerPrincipal().getName() is not enough since logins are not unique in my app. I need to pass additional parameter from JSF layer (user organization id), but I do not want to change each method's signature.
Is there any way to set custom parameter while user is logging into application (or generally in JSF layer), that is later visible for EJBs?
Upvotes: 2
Views: 287
Reputation: 3769
There are a couple of options.
For example, if a user logs in with "joe", then with most baked-in modules "joe" will be what's returned from context.getCallerPrincipal().getName().
With JASPIC you can make this any string, eg "joe.theboss::131::9634".
Upvotes: 2