Skip to content

Commit c0378b9

Browse files
committed
Set LDAP Samples to Use Zero Port
Issue gh-8762
1 parent bcfbd2d commit c0378b9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

samples/javaconfig/ldap/src/main/java/org/springframework/security/samples/config/SecurityConfig.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public void configureGlobal(
2929
auth
3030
.ldapAuthentication()
3131
.userDnPatterns("uid={0},ou=people")
32-
.groupSearchBase("ou=groups");
32+
.groupSearchBase("ou=groups")
33+
.contextSource().port(0);
3334
}
3435
// @formatter:on
35-
}
36+
}

samples/xml/ldap/src/main/webapp/WEB-INF/applicationContext-security.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<!-- Simple namespace-based configuration -->
1919

20-
<s:ldap-server ldif="classpath:users.ldif"/>
20+
<s:ldap-server ldif="classpath:users.ldif" port="0"/>
2121

2222
<s:authentication-manager>
2323
<s:ldap-authentication-provider

0 commit comments

Comments
 (0)