Coder Social home page Coder Social logo

alfresco-ldap's Introduction

Alfresco Ldap Manager

This module allows for managing alfresco internal users in an ldap directory.

Features

  • External users invited to Alfresco are placed in an ldap
  • Existing alfresco internal (alfrescoNtlm-users) can be moved to an ldap
  • Passwords are stored in ldap
  • Login is done against the ldap directory in the authentication chain

Building & packaging

This module is distributed as jar files. They can be built and installed into your local maven repository using "mvn clean install".

There is an enterprise module available for Alfresco 4.2.5.1+. This module can be excluded on older versions of Alfresco and on Community.

Installation

The files are also available in the Redpill Linpro public nexus server, which can be accessed in your own maven projects by adding the following dependencies and repository tags to your maven pom.xml for you repository project:

<dependencies>
  <dependency>
    <groupId>org.redpill-linpro.alfresco.ldap</groupId>
    <artifactId>alfresco-ldap-repo</artifactId>
    <version>1.0.1</version>
  </dependency>
</dependencies>
<dependencies>
  <dependency>
    <groupId>org.redpill-linpro.alfresco.ldap</groupId>
    <artifactId>alfresco-ldap-repo-enterprise</artifactId>
    <version>1.0.1</version>
  </dependency>
</dependencies>


<repositories>
  <repository>
    <id>redpill-linpro</id>
    <url>https://maven.redpill-linpro.com/nexus/content/groups/public</url>
    <snapshots>
      <enabled>true</enabled>
      <updatePolicy>daily</updatePolicy>
    </snapshots>
  </repository>
</repositories>

Configuration

Below are the default configuration parameters for the module. These can be modified to fit your own environment.

ldapMgr.java.naming.provider.url=ldap://localhost:33389
ldapMgr.java.naming.security.principal=uid=admin,ou=system
ldapMgr.java.naming.security.credentials=secret
ldapMgr.personQuery=(objectclass=organizationalPerson)
ldapMgr.userSearchBase=ou=users,dc=test,dc=alfresco,dc=redpill,dc=org
ldapMgr.groupSearchBase=ou=groups,dc=test,dc=alfresco,dc=redpill,dc=org

ldapMgr.objectClasses=person,organizationalPerson,inetOrgPerson
ldapMgr.passwordAttributeName=userPassword
# Uncomment the line below for AD
#ldapMgr.passwordAttributeName=unicodepwd
ldapMgr.givenNameAttributeName=givenName
ldapMgr.cnAttributeName=cn
#ldapMgr.cnBasedOn=givenName
ldapMgr.cnBasedOn=uid
ldapMgr.snAttributeName=sn
ldapMgr.mailAttributeName=mail
ldapMgr.userIdAttributeName=uid

ldapMgr.syncZoneId=ldap1
#Can be either ssha, sha, md5 or ad. Default is ssha
ldapMgr.passwordAlgorithm=ssha

#Set to true to remove password when users are migrated to the ldap directory
ldapMgr.resetPasswordOnPushSync=false

ldapMgr.enabled=false

You also need to add your ldap directory to your autentication chain and add synchronization as described in the Alfresco Documentation.

Migration

To migrate existing users to your ldap you can use the following code snippet in the JavaScript Console:

var node = search.findNode("workspace://SpacesStore/AUTH.ALF");


var num = 0;
for each(p in node.children) {
	if (p.typeShort != 'cm:person') {
		continue;
	}
	if (p.hasAspect("rlldap:temporaryPushSyncAspect")) {
		continue;
	}
	if (p.properties.userName.toLowerCase().equals("admin")) {
		continue;	
	}
	if (p.properties.userName.toLowerCase().equals("system")) {
		continue;	
	}
	if (p.properties.userName.toLowerCase().equals("systemuser")) {
		continue;	
	}
	if (p.properties.userName.toLowerCase().equals("guest")) {
		continue;	
	}

	try {
	  p.addAspect("rlldap:temporaryPushSyncAspect");
	} finally {
      //Do we really want to remove this aspect now? It could be used to send out new passwords etc.
	  //p.removeAspect("rlldap:temporaryPushSyncAspect");
		
	}
	
	logger.log("Moved user to external AD: "+p.properties.userName);
	num ++;
	if (num >= 50) {
		break;
	}
}
logger.log("Number of users moved to ldap: "+num);

alfresco-ldap's People

Contributors

aleksic87 avatar marsv024 avatar oakman avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.