You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Trustin Lee <tr...@gmail.com> on 2005/05/17 07:10:27 UTC

Re: [MINA] Where do i store a Principal?

Hell Ryan,

2005/5/17, Ryan Rhodes <ry...@hotmail.com>:
> Hello All
> 
> I posted a lot of questions to the Netty list and Trustin was always very
> helpful.  I'm really excited about the directions mina is taking.

It is good to see you again. :)

> I extended the reverser example into a simple chat server.  This is just
> like echo server except all incoming input is echo to all connections.  I do
> this by maintaining a list of IoSession in the protocol handler.
> 
> First question:  Does Mina already have some internal list of IoSession that
> I can use to loop through for output?  Is my list redundant?

No MINA doesn't manager list of sessions for now.  I'll add JIRA
issues for that.

> Second question:  Whats the best approach to adding authentication to a mina
> application?

You can implement it via filters or via handlers.  It is up to you. 
People often use filters when some functionality is considered
reusable.

> Is there any examples in apache directory that I can look at for integrating
> principals with mina?  I found an LdapPrincipal, but I could not find where
> the authentication logic happens relative to Mina.

AFAIK, LdapPricipal and other stuffs are stored in ThreadLocal not in
MINA session attribute map.  It is because ApacheDS can run without
MINA (embeded only mode).  We could let ApacheDS store its session
data into MINA session attribute map using in-VM pipe.  WDYT, Alex?

Thanks,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/

Re: [MINA] Where do i store a Principal?

Posted by Alex Karasulu <ao...@bellsouth.net>.
Trustin Lee wrote:

>AFAIK, LdapPricipal and other stuffs are stored in ThreadLocal not in
>MINA session attribute map.  It is because ApacheDS can run without
>MINA (embeded only mode).  We could let ApacheDS store its session
>data into MINA session attribute map using in-VM pipe.  WDYT, Alex?
>  
>
Don't have enough data cached at the moment on both MINA and ApacheDS to 
comment in depth.  However you do make a good point about needing the 
identity even when MINA is not being used ... in embedded mode where 
there is no LDAP access.  So I think we might want to leave it as is or 
find a neat way to bridge this part of the session info with that in MINA.

However as you said above (sorry may have snipped) where you manage your 
principal is really application dependent.  The best that can be done is 
to give the user the options as you did.

Cheers,
Alex