IoSession are given to ServerSession as parameters when those are built. You can access the IoSession using IoSession AbstractSession#getIoSession() and get the ServerSession from a IoSession using AbstractSession AbstractSession#getSession(IoSession session)
They don't share attributes though. On Fri, Jul 13, 2012 at 3:06 PM, Wright, Omari <[email protected]>wrote: > Does it matter that the type of sessions returned by > acceptor.getManagedSessions() are IoSessions instead of ServerSessions or > do they access the same attributes? > > -----Original Message----- > From: Guillaume Nodet [mailto:[email protected]] > Sent: Friday, July 13, 2012 8:49 AM > To: [email protected] > Subject: Re: [Apache SSHD] Question about authentication > > The UserAuth interface you'll have to implement is given the ServerSession > as a parameter and you can use get/setAttributes() to associate your id > with the ssh session. > When you want to kick users, you can enumerate the sessions using > sshServer.getActiveSessions() and check what you need there, eventually > calling close() on the sessions. > > On Fri, Jul 13, 2012 at 2:41 PM, Wright, Omari <[email protected] > >wrote: > > > I have OpenAM which I plan to use to handle user authentication again > > an Active Directory server. I plan to make a call during the SSHD > > authenticate method passing along username/password. The returned > > value of this call is a token id if it is successful and null > > otherwise. I then want to associate this value with the session as a > > type of session id. Is this possible? If so, how can I go about doing > this? > > > > The token id would basically be an added property on the session. The > > reason I want this functionality is that I then want to be able to > > kick users based off the token id passed to the disconnect method. The > > reason for this is a need to have OpenAM manage user disconnects. > > > > > > -- > ------------------------ > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ > ------------------------ > FuseSource, Integration everywhere > http://fusesource.com > -- ------------------------ Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ FuseSource, Integration everywhere http://fusesource.com
