You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jörn Heid <he...@agentsinaction.de> on 2003/11/26 21:30:53 UTC

Problem with JNDIRealm

I have successfully installed mod_auth_ldap with Apache.
Here's the configuration:

LDAP_Protocol_Version 2
LDAP_Server <server>
LDAP_Port <port>
Base_DN "ou=People,o=<company>,c=DE"
UID_Attr_Alt uid
require valid-user
Bind_DN "cn=appadmin,o=<company>,c=DE"
Bind_Pass <password>



I want to use this in Tomcat. I tested a lot of configurations. Here's one
of it:


   <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
     connectionURL="ldap://<server>:<port>"
       userPattern="uid={0},ou=People,o=<company>,c=DE"
          roleBase="ou=People,o=<company>,c=DE"
          roleName="uid"
        roleSearch="(uid={0})"
        roleSubtree="true"
        connectionName="cn=appadmin,o=<company>,c=DE"
        connectionPassword="<password>"
/>

When testing it with a working user/pass combination I get:

2003-11-26 21:17:29 JNDIRealm[Standalone]: lookupUser(jheid)
2003-11-26 21:17:29 JNDIRealm[Standalone]:
dn=uid=jheid,ou=People,o=<Company>,c=DE
2003-11-26 21:17:29 JNDIRealm[Standalone]:   validating credentials by
binding a
s the user
2003-11-26 21:17:29 JNDIRealm[Standalone]:   binding as
uid=jheid,ou=People,o=<Company>,c=DE
2003-11-26 21:17:29 JNDIRealm[Standalone]: Exception performing
authentication
javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object];
rema
ining name ''
        at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3013)
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2934)
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2740)
        at com.sun.jndi.ldap.LdapCtx.c_getAttributes(LdapCtx.java:1294)
        at
com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(Componen
tDirContext.java:213)
        at
com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(Par
tialCompositeDirContext.java:121)
        at
com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(Par
tialCompositeDirContext.java:109)
        at
javax.naming.directory.InitialDirContext.getAttributes(InitialDirCont
ext.java:121)
        at org.apache.catalina.realm.JNDIRealm.bindAsUser(JNDIRealm.java:127




But when I'm using a wrong user/pass combination, I get:

2003-11-26 21:27:59 JNDIRealm[Standalone]:   bind attempt failed
2003-11-26 21:27:59 JNDIRealm[Standalone]: Username jheid NOT successfully
authenticated



Can anybody help me please?

JOERN


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Problem with JNDIRealm

Posted by Chong Yu Meng <ch...@cymulacrum.net>.
It looks like one of you attributes is missing (i.e. null). Do you have 
a role associated with the username? I'm also having problems with 
JNDIRealm -- I can't get it working ! Going to check if it is because 
I'm missing some libraries.

Regards,
pascal chong


Jörn Heid wrote:

>I have successfully installed mod_auth_ldap with Apache.
>Here's the configuration:
>
>LDAP_Protocol_Version 2
>LDAP_Server <server>
>LDAP_Port <port>
>Base_DN "ou=People,o=<company>,c=DE"
>UID_Attr_Alt uid
>require valid-user
>Bind_DN "cn=appadmin,o=<company>,c=DE"
>Bind_Pass <password>
>
>
>
>I want to use this in Tomcat. I tested a lot of configurations. Here's one
>of it:
>
>
>   <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
>     connectionURL="ldap://<server>:<port>"
>       userPattern="uid={0},ou=People,o=<company>,c=DE"
>          roleBase="ou=People,o=<company>,c=DE"
>          roleName="uid"
>        roleSearch="(uid={0})"
>        roleSubtree="true"
>        connectionName="cn=appadmin,o=<company>,c=DE"
>        connectionPassword="<password>"
>/>
>
>When testing it with a working user/pass combination I get:
>
>2003-11-26 21:17:29 JNDIRealm[Standalone]: lookupUser(jheid)
>2003-11-26 21:17:29 JNDIRealm[Standalone]:
>dn=uid=jheid,ou=People,o=<Company>,c=DE
>2003-11-26 21:17:29 JNDIRealm[Standalone]:   validating credentials by
>binding a
>s the user
>2003-11-26 21:17:29 JNDIRealm[Standalone]:   binding as
>uid=jheid,ou=People,o=<Company>,c=DE
>2003-11-26 21:17:29 JNDIRealm[Standalone]: Exception performing
>authentication
>javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object];
>rema
>ining name ''
>        at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3013)
>        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2934)
>        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2740)
>        at com.sun.jndi.ldap.LdapCtx.c_getAttributes(LdapCtx.java:1294)
>        at
>com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(Componen
>tDirContext.java:213)
>        at
>com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(Par
>tialCompositeDirContext.java:121)
>        at
>com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(Par
>tialCompositeDirContext.java:109)
>        at
>javax.naming.directory.InitialDirContext.getAttributes(InitialDirCont
>ext.java:121)
>        at org.apache.catalina.realm.JNDIRealm.bindAsUser(JNDIRealm.java:127
>
>
>
>
>But when I'm using a wrong user/pass combination, I get:
>
>2003-11-26 21:27:59 JNDIRealm[Standalone]:   bind attempt failed
>2003-11-26 21:27:59 JNDIRealm[Standalone]: Username jheid NOT successfully
>authenticated
>
>
>
>Can anybody help me please?
>
>JOERN
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org