use of org.graylog2.security.ldap.LdapSettingsImpl in project graylog2-server by Graylog2.
the class LdapUserAuthenticatorTest method setUp.
@Before
public void setUp() throws Exception {
server = getLdapServer();
final LdapConnectionConfig ldapConfig = new LdapConnectionConfig();
ldapConfig.setLdapHost("localHost");
ldapConfig.setLdapPort(server.getPort());
ldapConfig.setName(ADMIN_DN);
ldapConfig.setCredentials(ADMIN_PASSWORD);
configuration = mock(Configuration.class);
when(configuration.getPasswordSecret()).thenReturn(PASSWORD_SECRET);
ldapConnector = new LdapConnector(10000);
ldapSettingsService = mock(LdapSettingsService.class);
userService = mock(UserService.class);
ldapSettings = new LdapSettingsImpl(configuration, mock(RoleService.class));
ldapSettings.setEnabled(true);
ldapSettings.setUri(URI.create("ldap://localhost:" + server.getPort()));
ldapSettings.setUseStartTls(false);
ldapSettings.setSystemUsername(ADMIN_DN);
ldapSettings.setSystemPassword(ADMIN_PASSWORD);
ldapSettings.setSearchBase("ou=users,dc=example,dc=com");
ldapSettings.setSearchPattern("(&(objectClass=posixAccount)(uid={0}))");
ldapSettings.setDisplayNameAttribute("cn");
ldapSettings.setActiveDirectory(false);
ldapSettings.setGroupSearchBase("ou=groups,dc=example,dc=com");
ldapSettings.setGroupIdAttribute("cn");
ldapSettings.setGroupSearchPattern("(|(objectClass=groupOfNames)(objectClass=posixGroup))");
}
Aggregations