You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Bragg, Casey" <Ca...@allegiancetelecom.com> on 2001/05/22 19:37:01 UTC
LDAPUserManager : getting the user's dn
This question concerns LDAPUserManager (in
org.apache.turbine.services.security.ldap).
Given the code from LDAPUserManager's public User retrieve(String username)
method :
while (answer.hasMore())
{
SearchResult sr = (SearchResult) answer.next();
Attributes attribs = sr.getAttributes();
Log.debug("attribs: " + attribs.get(dNAttribute));
dN = attribs.get(dNAttribute).toString();
Log.debug("dN: " + dN);
}
Maybe I'm reading this wrong, but this code seems to presume that each DN
has an attribute which contains the user's DN. Our LDAP tree (which matches
that used by iPlanet's mail server) doesn't appear to have such an
attribute. Wouldn't it be more appropriate to get the dN with the following
:
while (answer.hasMore())
{
dN = sr.getName();
}
Thanks...
...Casey
P.S. Should I post this kind of question here?
==============================================
Casey Bragg - Software Engineer
Allegiance Telecom, Inc. Dallas, TX
469-259-2702 - casey.bragg@allegiancetelecom.com
==============================================
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: LDAPUserManager : getting the user's dn
Posted by Colin Chalmers <co...@maxware.nl>.
Hi Casey,
On the one hand your totally correct, however if you were to look further at
the code you will see the following:
<snip>
LDAPUserManager.java:165: String dNAttribute =
TurbineResources.getString(LDAP_DN_ATTR);
LDAPUserManager.java:206: dN = attribs.get(dNAttribute).toString();
</snip>
So you see that the "dNAttribute" is actually a variable that is being set
by the setting(s) in the Resource file.
/colin
----- Original Message -----
From: "Bragg, Casey" <Ca...@allegiancetelecom.com>
To: <tu...@jakarta.apache.org>
Sent: Tuesday, May 22, 2001 7:37 PM
Subject: LDAPUserManager : getting the user's dn
> This question concerns LDAPUserManager (in
> org.apache.turbine.services.security.ldap).
>
> Given the code from LDAPUserManager's public User retrieve(String
username)
> method :
> while (answer.hasMore())
> {
> SearchResult sr = (SearchResult) answer.next();
> Attributes attribs = sr.getAttributes();
> Log.debug("attribs: " + attribs.get(dNAttribute));
> dN = attribs.get(dNAttribute).toString();
> Log.debug("dN: " + dN);
> }
>
> Maybe I'm reading this wrong, but this code seems to presume that each DN
> has an attribute which contains the user's DN. Our LDAP tree (which
matches
> that used by iPlanet's mail server) doesn't appear to have such an
> attribute. Wouldn't it be more appropriate to get the dN with the
following
> :
> while (answer.hasMore())
> {
> dN = sr.getName();
> }
>
> Thanks...
>
> ...Casey
>
> P.S. Should I post this kind of question here?
>
> ==============================================
> Casey Bragg - Software Engineer
> Allegiance Telecom, Inc. Dallas, TX
> 469-259-2702 - casey.bragg@allegiancetelecom.com
> ==============================================
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org