1
0
mirror of synced 2026-08-31 22:46:02 +00:00

Remove ApacheDS Support

Closes gh-13852
This commit is contained in:
Josh Cummings
2025-06-18 18:29:16 -06:00
parent 42e24aa53c
commit 6ddb964c61
49 changed files with 138 additions and 1406 deletions
+3 -7
View File
@@ -166,13 +166,9 @@ The top-level package is `org.springframework.security.ldap`.
|
| Data exception classes are required.
| apache-ds
| 1.5.5
| Required if you are using an embedded LDAP server (optional). If you use `apache-ds`, the `apacheds-core`, `apacheds-core-entry`, `apacheds-protocol-shared`, `apacheds-protocol-ldap` and `apacheds-server-jndi` modules are required.
| shared-ldap
| 0.9.15
| Required if you are using an embedded LDAP server (optional).
| com.unboundid:unboundid-ldapsdk
|
| Required if using an embedded LDAP server
| ldapsdk
| 4.1
@@ -363,7 +363,7 @@ This section addresses common Spring Security architecture questions:
. <<appendix-faq-namespace-to-bean-mapping>>
. <<appendix-faq-role-prefix>>
. <<appendix-faq-what-dependencies>>
. <<appendix-faq-apacheds-deps>>
. <<appendix-faq-unboundid-deps>>
. <<appendix-faq-what-is-userdetailservice>>
@@ -412,30 +412,39 @@ The reference manual also includes <<appendix-namespace,an appendix>> that lists
If you build your project with Maven, adding the appropriate Spring Security modules as dependencies to your `pom.xml` file automatically pulls in the core jars that the framework requires.
Any that are marked as "`optional`" in the Spring Security `pom.xml` files have to be added to your own `pom.xml` file if you need them.
[[appendix-faq-unboundid-deps]]
=== What dependences are needed to run an embedded UnboundID LDAP server?
You need to add the following dependency to your project:
[tabs]
======
Maven::
+
[source,maven,role="primary"]
----
<dependency>
<groupId>com.unboundid</groupId>
<artifactId>unboundid-ldapsdk</artifactId>
<version>7.0.1</version>
<scope>runtime</scope>
</dependency>
----
Gradle::
+
[source,gradle,role="secondary"]
----
implementation 'com.unboundid:unboundid-ldapsdk:7.0.1'
----
======
[[appendix-faq-apacheds-deps]]
=== What dependencies are needed to run an embedded ApacheDS LDAP server?
If you use Maven, you need to add the following to your `pom.xml` file dependencies:
[source]
----
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-core</artifactId>
<version>1.5.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-server-jndi</artifactId>
<version>1.5.5</version>
<scope>runtime</scope>
</dependency>
----
The other required jars should be pulled in transitively.
Spring Security 7 removes support for Apache DS.
Please use <<appendix-faq-unboundid-deps,UnboundID>> instead.
[[appendix-faq-what-is-userdetailservice]]
=== What is a UserDetailsService and do I need one?
@@ -24,7 +24,7 @@ This is actually the bean `id` of the `ContextSource` instance, if you want to u
[[nsa-ldap-server-mode]]
* **mode**
Explicitly specifies which embedded ldap server should use. Values are `apacheds` and `unboundid`. By default, it will depends if the library is available in the classpath.
Explicitly specifies which embedded ldap server should use. The only supported value is `unboundid`. By default, it will depends if the library is available in the classpath.
[[nsa-ldap-server-id]]
* **id**
@@ -223,82 +223,8 @@ fun ldapContainer(): UnboundIdContainer {
[[servlet-authentication-ldap-apacheds]]
=== Embedded ApacheDS Server
[NOTE]
====
Spring Security uses ApacheDS 1.x, which is no longer maintained.
Unfortunately, ApacheDS 2.x has only released milestone versions with no stable release.
Once a stable release of ApacheDS 2.x is available, we will consider updating.
====
If you wish to use https://directory.apache.org/apacheds/[Apache DS], specify the following dependencies:
.ApacheDS Dependencies
[tabs]
======
Maven::
+
[source,xml,role="primary",subs="+attributes"]
----
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-core</artifactId>
<version>{apacheds-core-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-server-jndi</artifactId>
<version>{apacheds-core-version}</version>
<scope>runtime</scope>
</dependency>
----
Gradle::
+
[source,groovy,role="secondary",subs="+attributes"]
----
depenendencies {
runtimeOnly "org.apache.directory.server:apacheds-core:{apacheds-core-version}"
runtimeOnly "org.apache.directory.server:apacheds-server-jndi:{apacheds-core-version}"
}
----
======
You can then configure the Embedded LDAP Server:
.Embedded LDAP Server Configuration
[tabs]
======
Java::
+
[source,java,role="primary"]
----
@Bean
ApacheDSContainer ldapContainer() {
return new ApacheDSContainer("dc=springframework,dc=org",
"classpath:users.ldif");
}
----
XML::
+
[source,xml,role="secondary"]
----
<b:bean class="org.springframework.security.ldap.server.ApacheDSContainer"
c:defaultPartitionSuffix="dc=springframework,dc=org"
c:ldif="classpath:users.ldif"/>
----
Kotlin::
+
[source,kotlin,role="secondary"]
----
@Bean
fun ldapContainer(): ApacheDSContainer {
return ApacheDSContainer("dc=springframework,dc=org", "classpath:users.ldif")
}
----
======
Spring Security 7 removes support for Apache DS.
Please use <<servlet-authentication-ldap-unboundid,UnboundID>> instead.
[[servlet-authentication-ldap-contextsource]]
== LDAP ContextSource
@@ -15,7 +15,7 @@ For example, adding the following element from the `security` namespace to an ap
<security:ldap-server />
----
This is much simpler than wiring up the equivalent Apache Directory Server beans.
This is much simpler than wiring up the equivalent UnboundID Server beans.
The most common alternative configuration requirements are supported by attributes on the `ldap-server` element, and the user is isolated from worrying about which beans they need to create and what the bean property names are.
You can find out more about the use of the `ldap-server` element in the chapter on xref:servlet/authentication/passwords/ldap.adoc#servlet-authentication-ldap[LDAP Authentication].
A good XML editor while editing the application context file should provide information on the attributes and elements that are available.