Skip to content

Commit

Permalink
issue-1614: Embedded Ldap Server anonymous read fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anki2189 authored and steve-todorov committed Feb 19, 2020
1 parent 6a8cad0 commit 786e381
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public LdapConfiguration map(Map<String, Object> source)

result.setUrl((String) source.get(URL));
result.setManagerDn((String) source.get(MANAGER_DN));
result.setManagerPassword((String) source.get(MANAGER_PASSWORD));
result.setManagerPassword(String.valueOf(source.get(MANAGER_PASSWORD)));

LdapGroupSearch groupSearch = new LdapGroupSearch();
groupSearch.setGroupSearchBase((String) source.get(GROUP_SEARCH_BASE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
<constructor-arg
value="${strongbox.authentication.ldap.url}" />
<property name="anonymousReadOnly" value="true" />
<property name="anonymousReadOnly" value="false" />
<property name="userDn" value="${strongbox.authentication.ldap.managerDn}"/>
<property name="password" value="${strongbox.authentication.ldap.managerPassword}"/>
</bean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">

<security:ldap-server id="ldapServer" ldif="classpath:strongbox.ldif" root="dc=carlspring,dc=com" port="53389" />
<security:ldap-server id="ldapServer" ldif="classpath:strongbox.ldif" root="dc=carlspring,dc=com" port="53389" manager-password="secret" manager-dn="uid=admin,ou=system"/>

</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ public void ldapConfigurationTestShouldFailWithInvalidConfiguration()

@WithMockUser(authorities = "ADMIN")
@Test()
@Disabled
public void ldapConfigurationTestShouldFailWithWithInvalidManagerDn()
{
LdapConfigurationTestForm form = getLdapConfigurationTestForm();
Expand Down Expand Up @@ -317,6 +316,8 @@ private LdapConfigurationTestForm getLdapConfigurationTestForm()

LdapConfiguration configuration = ldapAuthenticationConfigurationManager.getConfiguration();
form.setConfiguration(configuration);
form.getConfiguration().setManagerDn("uid=admin,ou=system");
form.getConfiguration().setManagerPassword("secret");
return form;
}

Expand Down

0 comments on commit 786e381

Please sign in to comment.