[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-user
Subject:    Re: The relationship between Tomcat security mechanism and
From:       Francis Pallini <pallini () clamart ! oilfield ! slb ! com>
Date:       2001-07-31 16:12:21
[Download RAW message or body]

Hello,

I had the same problem, but I never managed to get the LDAP login module at 
work. In theory, you can use this JAAS module to check user authentication 
and get user roles from the LDAP server with a very few code. JNDI login 
module is very poorly documented...

By now, the following code works for what I have to do, event if it is not 
very elegant :

     String buf = "alias=zorglub,ou=employee,o=XXX,c=AN";
     Hashtable env = new Hashtable();
     out.println("String: "+buf);
     env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
     env.put(Context.PROVIDER_URL, "ldap://ldap.xxx.com:389/o=xxx,c=an");
     env.put(Context.SECURITY_AUTHENTICATION, "simple");
     env.put(Context.SECURITY_PRINCIPAL, buf.toString());
//    env.put(Context.SECURITY_CREDENTIALS, "toto");

     try{
       DirContext ctx = new InitialDirContext(env);
       out.println("Authenticated");
     }
     catch (NamingException ae) {
       out.println("Not Authenticated");
     }

Regards,

Francis Pallini

At 03:59 PM 7/31/01 +0530, you wrote:
>hi Francis !
>    i too have a query regards security..in particular authentication.
>    my intranet has LDAP where as one of my applications...i.e "jetspeed"
>maintains a databse for user-authentication....
>   so a user has to authenticate himself again if he comes to jetspeed from
>his INTRANET page...
>   is there a way we can have a common authntication?...more
>specifically...how can i enable my LDAP to talk to my jetspeed or vice
>versa.  how can JAAS help me in this regard ?
>
>Please help.
>
>TIA
>
>sumit ranjan

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic