Files
spring-ldap/samples/user-admin
Spring Operator c6688a2704 URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* http://junit.sourceforge.net/javadoc/ (200) migrated to:
  http://junit.sourceforge.net/javadoc/ ([https](https://junit.sourceforge.net/javadoc/) result AnnotatedConnectException).
* http://www.261consulting.com (200) migrated to:
  http://www.261consulting.com ([https](https://www.261consulting.com) result ConnectTimeoutException).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* http://forums.gradle.org/gradle/topics/after_upgrade_gradle_to_2_0_version_the_maven_pom_not_support_build_property (301) migrated to:
  https://discuss.gradle.org/gradle/topics/after_upgrade_gradle_to_2_0_version_the_maven_pom_not_support_build_property ([https](https://forums.gradle.org/gradle/topics/after_upgrade_gradle_to_2_0_version_the_maven_pom_not_support_build_property) result 404).
* http://download.java.net/maven/2/ (301) migrated to:
  https://download.java.net/maven/2/ ([https](https://download.java.net/maven/2/) result 404).

## Fixed Success
These URLs were fixed successfully.

* http://commons.apache.org/proper/commons-dbcp/apidocs/ migrated to:
  https://commons.apache.org/proper/commons-dbcp/apidocs/ ([https](https://commons.apache.org/proper/commons-dbcp/apidocs/) result 200).
* http://commons.apache.org/proper/commons-logging/apidocs/ migrated to:
  https://commons.apache.org/proper/commons-logging/apidocs/ ([https](https://commons.apache.org/proper/commons-logging/apidocs/) result 200).
* http://commons.apache.org/proper/commons-pool/apidocs/ migrated to:
  https://commons.apache.org/proper/commons-pool/apidocs/ ([https](https://commons.apache.org/proper/commons-pool/apidocs/) result 200).
* http://docs.oracle.com/javase/7/docs/api/ migrated to:
  https://docs.oracle.com/javase/7/docs/api/ ([https](https://docs.oracle.com/javase/7/docs/api/) result 200).
* http://docs.spring.io/spring/docs/3.2.x/javadoc-api/ migrated to:
  https://docs.spring.io/spring/docs/3.2.x/javadoc-api/ ([https](https://docs.spring.io/spring/docs/3.2.x/javadoc-api/) result 200).
* http://logging.apache.org/log4j/1.2/apidocs/ migrated to:
  https://logging.apache.org/log4j/1.2/apidocs/ ([https](https://logging.apache.org/log4j/1.2/apidocs/) result 200).
* http://springsource.org/ (301) migrated to:
  https://spring.io ([https](https://springsource.org/) result 200).
* http://www.apache.org/licenses/LICENSE-2.0.txt migrated to:
  https://www.apache.org/licenses/LICENSE-2.0.txt ([https](https://www.apache.org/licenses/LICENSE-2.0.txt) result 200).
* http://www.jayway.com migrated to:
  https://www.jayway.com ([https](https://www.jayway.com) result 200).
* http://static.springframework.org/spring-ldap/docs (301) migrated to:
  https://docs.spring.io/spring-ldap/docs ([https](https://static.springframework.org/spring-ldap/docs) result 301).
* http://repo.springsource.org/libs-snapshot migrated to:
  https://repo.springsource.org/libs-snapshot ([https](https://repo.springsource.org/libs-snapshot) result 301).
* http://www.springframework.org/ldap migrated to:
  https://www.springframework.org/ldap ([https](https://www.springframework.org/ldap) result 301).

# Ignored
These URLs were intentionally ignored.

* http://maven.apache.org/POM/4.0.0
* http://maven.apache.org/xsd/maven-4.0.0.xsd
* http://www.w3.org/2001/XMLSchema-instance
2019-03-05 21:28:09 -06:00
..
2019-03-05 21:28:09 -06:00

User Admin Sample

Sample application demonstrating how to do some real work with Spring LDAP. This is a fully functional LDAP user administration application. It uses many of the useful concepts in Spring LDAP and would serve as a good example for best practices and various useful tricks.

Users and Groups in LDAP

Users in LDAP are usually represented as organizationalPerson or inetOrgPerson entries in the LDAP tree. The attributes in these entries represent the basic information on the users, e.g. (subset of available attributes):

  • cn: Common Name, or full name of the user
  • sn: Surname
  • mail: Email address
  • telephoneNumber: Phone number
  • ...several more attributes are available

Groups in LDAP are typically organized in groupOfName or groupOfUniqueName entries. These entries have a name, an optional description, and an attribute containing the distinguished names (i.e. the unique identifiers) of all members of the group. This attribute is named member and uniqueMember respectively.

Thus, user administration in LDAP typically involves creating and manipulating orgalizationalPerson or inetOrgPerson entries and adding or removing references to these entries in groupOfName or groupOfUniqueName entries.

This application demonstrates to do this easily and efficiently using Spring LDAP.

Application Structure

The core Spring application context of the sample is defined in resources/applicationContext.xml. By default this ApplicationContext will start an in-process Apache Directory Server instance, automatically populated with some test data. The data will be reset every time the application is restarted.

Running the Example

To run the example, do gradle jettyRun, or mvn jetty:run, and then navigate to http://localhost:8080/spring-ldap-user-admin-sample

It is also possible to run this sample application against a remote LDAP server as opposed to starting an in-process LDAP server. To do this, use the following system properties:

  • spring.profiles.active - set this to no-apacheds to prevent the in-process ApacheDs to be launched
  • sample.ldap.url - the URL of the target LDAP server
  • sample.ldap.userDn - principal to use for authentication against the LDAP server
  • sample.ldap.password - authentication password
  • sample.ldap.base - the directory root to use - note that by default all data under this node will be deleted and replaced with test data
  • sample.ldap.clean - set this property to false to not clear the root node
  • sample.ldap.directory.type - NORMAL or AD. Specify AD if running against Active Directory in order to enable some particular AD tweaks

Example:

gradle jettyRun -Dspring.profiles.active=no-apacheds -Dsample.ldap.url=ldaps://127.0.0.1:636 \
 -Dsample.ldap.userDn=CN=ldaptest,CN=Users,DC=261consulting,DC=local -Dsample.ldap.password=secret \
 -Dsample.ldap.base=ou=test,dc=261consulting,dc=local -Dsample.ldap.directory.type=AD

mvn jetty:run -Dspring.profiles.active=no-apacheds -Dsample.ldap.url=ldaps://127.0.0.1:636 \
 -Dsample.ldap.userDn=CN=ldaptest,CN=Users,DC=261consulting,DC=local -Dsample.ldap.password=secret \
 -Dsample.ldap.base=ou=test,dc=261consulting,dc=local -Dsample.ldap.directory.type=AD

This sample uses Bootstrap to present a decent web design - copyright 2013 Twitter, Inc; distributed under the Apache 2 License.