From c0378b9d3587e6f9bc3234bb4be4f90724c97bbd Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Sat, 26 Sep 2020 15:17:52 -0600 Subject: [PATCH] Set LDAP Samples to Use Zero Port Issue gh-8762 --- .../security/samples/config/SecurityConfig.java | 5 +++-- .../src/main/webapp/WEB-INF/applicationContext-security.xml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/samples/javaconfig/ldap/src/main/java/org/springframework/security/samples/config/SecurityConfig.java b/samples/javaconfig/ldap/src/main/java/org/springframework/security/samples/config/SecurityConfig.java index 116219d418..da5de6aa67 100644 --- a/samples/javaconfig/ldap/src/main/java/org/springframework/security/samples/config/SecurityConfig.java +++ b/samples/javaconfig/ldap/src/main/java/org/springframework/security/samples/config/SecurityConfig.java @@ -29,7 +29,8 @@ public class SecurityConfig { auth .ldapAuthentication() .userDnPatterns("uid={0},ou=people") - .groupSearchBase("ou=groups"); + .groupSearchBase("ou=groups") + .contextSource().port(0); } // @formatter:on -} \ No newline at end of file +} diff --git a/samples/xml/ldap/src/main/webapp/WEB-INF/applicationContext-security.xml b/samples/xml/ldap/src/main/webapp/WEB-INF/applicationContext-security.xml index 0369dd109e..1448f21d21 100644 --- a/samples/xml/ldap/src/main/webapp/WEB-INF/applicationContext-security.xml +++ b/samples/xml/ldap/src/main/webapp/WEB-INF/applicationContext-security.xml @@ -17,7 +17,7 @@ - +