Frederic, Guillaume,
Thank you very much. That's exactly what I was looking for! :)

Regards,
Tomek

On Tue, 22 Nov 2011 11:15:06 +0100, Guillaume Nodet wrote:
Another way if you need more low-level information is to have your command
implement SessionAware.
In that case, it will receive the ServerSession object which you can use
for various purposes, including retrieving the user name using
    ((ServerSession) session).getUsername()

But you can't have access to those information in the CommandFactory itself.

2011/11/22 Frédéric Menou <frederic.me...@gmail.com>

Hi,

You simply get the user from Environment parameter :
public void start(Environment env) throws IOException {
 env.getEnv().get(Environment.ENV_USER);
 ...
}

When the command is executed, you're sure the user has been authenticated
(thru filters).

Regards,
Frederic

On Tue, Nov 22, 2011 at 09:28, Tomek Koprowski <to...@koprowski.org>
wrote:

> Hi,
> I'm developing a multi-user application based around MINA SSHD using
> CommandFactory (I don't need a shell). The problem is as follows:
commands
> should behave differently depending on logged on user (somewhat like > executing on the user's behalf). To do that I need to know _who_ is my
> command serving but I can't figure out a way to do that.
>
> Is there a way to pass the username into a Command created by the
> CommandFactory?
>
> Regards,
> Tomek
>
> --
> [ mailto:to...@koprowski.org  gg#:2348134 ]
> [       http://koprowski.org/photo        ]
> [    Life is as bad as you make it be     ]
>
>


--
Frédéric Menou


--
[ mailto:to...@koprowski.org  gg#:2348134 ]
[        http://koprowski.org/misc        ]
[    Life is as bad as you make it be     ]

Reply via email to