-
1. Re: Getting the caller from the context
annapurna Dec 12, 2002 9:22 PM (in response to annapurna)Hi I figured how to make this from the command line. It does work from a HTML/Structs client. I get a *UNABLE TO FIND LOGINMODULE* exception.Can someone help.
Thanks in advance -
2. Re: Getting the caller from the context
srini Dec 16, 2002 5:04 AM (in response to annapurna)Hi AnnaPurna,
This is Srini,Coming to your problem if ur working with EJBSecurity and wnat to do it programatically there are methods in EJBContext Interface with name getCallerprincipal() whcih will give u the caller in role.just go throgh the methods isCallerInRole() and getCallerPrincipal() for programatic security.
For declarative security of beans u can mention in ejb-jar.xml file for secutiy-role giving rolename and method-permissions.just go through wrox J2ee server programming u 'll get the information.for any doubts get back
bye
Srini -
3. Re: Getting the caller from the context
srini Dec 16, 2002 5:05 AM (in response to annapurna)Hi AnnaPurna,
This is Srini,Coming to your problem if ur working with EJBSecurity and wnat to do it programatically there are methods in EJBContext Interface with name getCallerprincipal() whcih will give u the caller in role.just go throgh the methods isCallerInRole() and getCallerPrincipal() for programatic security.
For declarative security of beans u can mention in ejb-jar.xml file for secutiy-role giving rolename and method-permissions.just go through wrox J2ee server programming u 'll get the information.for any doubts get back
bye
Srini -
4. Re: Getting the caller from the context
annapurna Dec 19, 2002 12:31 PM (in response to annapurna)Hi Srini,
Thanks for the information. I think I have half the problem solved. Let me explain to you the rest of the problem.
I am doing a LoginContext using the following code.
AppCallbackHandler handler = new AppCallbackHandler(login, password.toCharArray());
//a default login module in jboss
LoginContext lc = new LoginContext("client-login", handler);
lc.login();
So that any user can logon to Jboss. It works well for one user but when I have multiple users there are problems.
In my stateful session bean the callerprincipal becomes the last logged in user when there are multiple clients.
The session context and the session id of the stateful session bean are different to both the clients. But the callerprinciapal is always the last logged on user.
Can someone help me how to get this working.
Thanks,
Annapurna