Spring LDAP - Reference Documentation

Mattias Arthursson

Ulrik Sandberg

Eric Dalquist

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.


Table of Contents

Preface
1. Introduction
Overview
Packaging overview
Package structure
org.springframework.transaction.compensating
org.springframework.ldap
org.springframework.ldap.core
org.springframework.ldap.core.support
org.springframework.ldap.core.simple
org.springframework.ldap.pool
org.springframework.ldap.pool.factory
org.springframework.ldap.pool.validation
org.springframework.ldap.support
org.springframework.ldap.authentication
org.springframework.ldap.control
org.springframework.ldap.filter
org.springframework.ldap.transaction.compensating
org.springframework.ldap.transaction.compensating.manager
org.springframework.ldap.transaction.compensating.support
Support
2. Basic Operations
Search and Lookup Using AttributesMapper
Building Dynamic Filters
Building Dynamic Distinguished Names
Binding and Unbinding
Binding Data
Unbinding Data
Modifying
Modifying using rebind
Modifying using modifyAttributes
Sample applications
3. Simpler Attribute Access and Manipulation with DirContextAdapter
Introduction
Search and Lookup Using ContextMapper
The AbstractContextMapper
Binding and Modifying Using DirContextAdapter
Binding
Modifying
A Complete PersonDao Class
4. Adding Missing Overloaded API Methods
Implementing Custom Search Methods
Implementing Other Custom Context Methods
5. Processing the DirContext
Custom DirContext Pre/Postprocessing
Implementing a Request Control DirContextProcessor
Paged Search Results
6. Transaction Support
Introduction
Configuration
JDBC Transaction Integration
LDAP Compensating Transactions Explained
Renaming Strategies
7. Java 5 Support
SimpleLdapTemplate
8. Configuration
ContextSource Configuration
LDAP Server URLs
Base LDAP path
DirContext Authentication
Native Java LDAP Pooling
Advanced ContextSource Configuration
LdapTemplate Configuration
Ignoring PartialResultExceptions
Obtaining a reference to the base LDAP path
9. Pooling Support
Introduction
DirContext Validation
Pool Properties
Configuration
Validation Configuration
Known Issues
Custom Authentication
10. User Authentication using Spring LDAP

List of Figures

1.1. Spring LDAP package structure

List of Tables

6.1.
9.1. Pooling Configuration Properties

List of Examples

2.1. AttributesMapper that returns a single attribute
2.2. AttributesMapper that returns a Person object
2.3. A lookup resulting in a Person object
2.4. Building a search filter dynamically
2.5. Building a wildcard search filter
2.6. Building a distinguished name dynamically
2.7. Binding data using Attributes
2.8. Unbinding data
2.9. Modifying using rebind
2.10. Modifying using modifyAttributes
3.1. Searching using a ContextMapper
3.2. Getting multi-value attribute values using getStringAttributes()
3.3. Using an AbstractContextMapper
3.4. Binding using DirContextAdapter
3.5. Modifying using DirContextAdapter
3.6. Binding and modifying using DirContextAdapter
3.7. A complete PersonDao class
4.1. A custom search method using SearchExecutor and AttributesMapper
4.2. A custom search method using SearchExecutor and ContextMapper
4.3. A custom DirContext method using ContextExecutor
5.1. A request control DirContextProcessor implementation
5.2. Paged results using PagedResultsRequestControl
7.1. Using ParameterizedContextMapper
8.1. The Spring bean definition for a SpringSecurityAuthenticationSource
8.2. Configuring a DefaultValuesAuthenticationSourceDecorator
8.3. Implementing BaseLdapPathAware
8.4. Specifying a BaseLdapPathBeanPostProcessor in your ApplicationContext
10.1. Using ContextSource for user authentication
10.2. Finding a user based on uid attribute.
10.3. Performing LDAP operation on returned DirContext objects.