Created
May 10, 2017 09:23
-
-
Save edgarmueller/31dcdb0303e7d4324852481c8dd6d97b to your computer and use it in GitHub Desktop.
EMFStore LDAP Example Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LDAPUserVerifierTest extends ESTestWithMockServer { | |
@BeforeClass | |
public static void beforeClass() { | |
startEMFStore(); | |
} | |
@AfterClass | |
public static void afterClass() { | |
stopEMFStore(); | |
} | |
@Test | |
public void ldapVerifyUser() throws AccessControlException { | |
final ESOrgUnitRepositoryImpl repository = new ESOrgUnitRepositoryImpl(getServerMock().getServerSpace()); | |
final ESOrgUnitProvider orgUnitProvider = new ESOrgUnitProviderImpl(repository); | |
final LDAPUserVerifier ldapVerifier = new LDAPUserVerifier( | |
orgUnitProvider, | |
"ldap://ldap.forumsys.com", // url | |
"dc=example,dc=com", // base | |
"uid", // searchdn | |
"cn=read-only-admin,dc=example,dc=com", // authuser | |
"password"); // authpass | |
assertTrue(ldapVerifier.verifyPassword("gauss", "password")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment