LDAPSecurityProvider provider = new LDAPSecurityProvider(getSecurityManager()); LDAPAuthenticationProvider authProvider = (LDAPAuthenticationProvider) provider .createAuthenticationProvider(ldapConfig);
@Before public void setUp() throws Exception { tempFolder = File.createTempFile("ldap", "test"); tempFolder.delete(); tempFolder.mkdirs(); GeoServerResourceLoader resourceLoader = new GeoServerResourceLoader(tempFolder); securityManager = new GeoServerSecurityManager(new GeoServerDataDirectory(resourceLoader)); securityProvider = new LDAPSecurityProvider(securityManager); createConfig(); config.setServerURL(ldapServerUrl + "/" + basePath); config.setGroupSearchBase("ou=Groups"); config.setGroupSearchFilter("member=cn={1}"); config.setUseTLS(false); authentication = new UsernamePasswordAuthenticationToken("admin", "admin"); authenticationOther = new UsernamePasswordAuthenticationToken("other", "other"); }
@Override public void setUp() throws Exception { tempFolder = File.createTempFile("ldap", "test"); tempFolder.delete(); tempFolder.mkdirs(); GeoServerResourceLoader resourceLoader = new GeoServerResourceLoader( tempFolder); securityManager = new GeoServerSecurityManager( new GeoServerDataDirectory(resourceLoader)); securityProvider = new LDAPSecurityProvider(securityManager); config = new LDAPSecurityServiceConfig(); config.setServerURL(ldapServerUrl + "/" + basePath); config.setGroupSearchBase("ou=Groups"); config.setGroupSearchFilter("member=cn={1}"); config.setUseTLS(false); authentication = new UsernamePasswordAuthenticationToken("admin", "admin"); authenticationOther = new UsernamePasswordAuthenticationToken("other", "other"); }