Archived
glacier2: retrieve the session user id of who invokes a call
Hi,
We've got some servants running behind icegrid / glacier2
- some servants run as root (1 instance each)
- some are allocatable, they run as the authenticated user, in the icegrid xml it's set to activation="session" user="${session.id}"
A client user logs on via username/password (permission verifier) and creates the session. The default session manager is being used.
So now, at the server side, how do we get the user identity of who is invoking a remote call?
Can it be retrieved via the Current object?
Thanks in advance!
Comments
-
Hi,
No, you can't retrieve this information through the
Ice.Currentobject. I suggest that you setup a property in the server configuration with the session ID, for example:<property name="SessionId" value="${session.id}"/>You can then read this property in the servant implementation.
Cheers,
Benoit.0 -
Hi,
I do know which servant runs as root and which is allocated by whom, but what I'd like to know is: 'who is the user which makes a remote call to this root servant'?
For example, servant S runs as root, then user X logs on via glacier2/permissionVerifier, the user X makes a remote method call to S... so now within S's method I'd like to know who the user was that made the call. (The answer should be user X.)
Is this possible in any way? I've searched around, but I may have missed it.
Thanks,
Wout0 -
Hi,
Ice doesn't provide this information. This is something the client will need to provide to the server. You could use request contexts to pass this information.
Cheers,
Benoit.0
