You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Craig Berry <cb...@gluecode.com> on 2001/03/01 23:55:00 UTC

[PATCH] LDAP user authentication

We have developed an LDAP user authentication implementation, the source
for which can be found at

  http://www.gluecode.com/turbineldap_src/

Since these are new classes rather than patches we're just providing the
files themselves, which can be viewed directly by following the org/ dir
path down, or you can get the whole set in ldap.tar.

The one component we weren't sure how to handle was
TurbineResources.properties/master.  We added new attributes to allow
ldap configuration, which we'd like to have in place but commented out
for normal users.  Search on 'ldap' in TurbineResources_LDAP to see our
changes.

Since we don't have commit authority, we're requesting that someone
commit these changes for us.  Please contact me if there are any
questions or comments, and thanks in advance.

-- 
Craig Berry - (310) 570-4140
VP Technology
GlueCode
1452 Second St
Santa Monica CA 90401


Re: [PATCH] LDAP user authentication

Posted by Jason van Zyl <jv...@periapt.com>.
Wow! Thanks!

I know a lot of people have been asking about an LDAP
Security Service. I have an LDAP server running here so
I will take a whirl at integrating the code into the repository.
I'm sure Rafal will also take a gander at it, but I will
try to get it in so that it's in CVS.

jvz.

On Thu, 1 Mar 2001, Craig Berry wrote:

> We have developed an LDAP user authentication implementation, the source
> for which can be found at
> 
>   http://www.gluecode.com/turbineldap_src/
> 
> Since these are new classes rather than patches we're just providing the
> files themselves, which can be viewed directly by following the org/ dir
> path down, or you can get the whole set in ldap.tar.
> 
> The one component we weren't sure how to handle was
> TurbineResources.properties/master.  We added new attributes to allow
> ldap configuration, which we'd like to have in place but commented out
> for normal users.  Search on 'ldap' in TurbineResources_LDAP to see our
> changes.
> 
> Since we don't have commit authority, we're requesting that someone
> commit these changes for us.  Please contact me if there are any
> questions or comments, and thanks in advance.
> 
> -- 
> Craig Berry - (310) 570-4140
> VP Technology
> GlueCode
> 1452 Second St
> Santa Monica CA 90401
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
> 
> 


Re: [PATCH] LDAP user authentication

Posted by Jon Stevens <jo...@latchkey.com>.
Hi Craig,

Thanks for the contribution.

Several issues:

#1. 
http://www.gluecode.com/turbineldap_src/org/apache/turbine/services/security
/LDAPSecurityService.java

ie:

      try {
        super.init(data);
       }

i know this is a small case, but please follow coding guidelines documented
here:

<http://jakarta.apache.org/turbine/code-standards.html>

Keeping Turbine's code consistent is imperative for a successful community.

#2. More coding conventions...


 */


public class LDAPUserManager implements UserManager
{

There should be no space between Javadoc and the class declaration. This
occurs in several places.

#3. 
<http://www.gluecode.com/turbineldap_src/org/apache/turbine/services/securit
y/LDAPUserManager.java>

       String dNAttribute    =
TurbineResources.getString("ldap.dn.attribute");
       String filter         =
TurbineResources.getString("ldap.user.search.filter");
       String userBaseSearch =
TurbineResources.getString("ldap.user.basesearch");
       String dN             = null;


You really should use the Services framework methodology of retrieving the
Resources by key. There are several examples on how to do this in other
services. This goes back to the lines that you want added into the TR.props
file.

           throw new DataBackendException("The method forcePassword has no
implementation Jetspeed v1.0");
 
eh?

again, coding conventions need to be followed (there are several places in
this file where they are broken)...

> if (errno.equals("49"))
> throw new UnknownEntityException("The given credentials for the administrator
> are invalid");
> else if (errno.equals("22"))
> throw new DataBackendException("The LDAP server specified is unavailable");
> else
> {
> throw nE;
> }

Again, consistency is imperative.

#4. 
http://www.gluecode.com/turbineldap_src/org/apache/turbine/services/security
/ldap/

seems to be a duplicate of:

http://www.gluecode.com/turbineldap_src/org/apache/turbine/services/security
/

#5. 
http://www.gluecode.com/turbineldap_src/org/apache/turbine/modules/actions/L
DAPLoginUser.java

package should be before the license.

why isn't this a static method (which would prevent having to do a new
LDAPUserManager()? also, why isn't there a check for null values before
calling this method:

    ldapUser = ldapUM.retrieve(username);
 

no offense, but I could keep going and going and pointing out errors in this
code, but i think they are pretty obvious.

please resubmit cleaner code.

-jon