Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws Exception{
- LdapContextSource contextSource = new LdapContextSource();
- contextSource.setUrl("ldap://IP:3268");
- contextSource.setBase("DC=Borrame,DC=COM");
- contextSource.setUserDn(");
- contextSource.setPassword("");
- contextSource.afterPropertiesSet();
- LdapTemplate ldapTemplate = new LdapTemplate(contextSource);
- ldapTemplate.afterPropertiesSet();
- // Perform the authentication.
- Filter filter = new EqualsFilter("sAMAccountName", "usuario");
- boolean authed = ldapTemplate.authenticate("OU=Grupo",
- filter.encode(),
- "");
- // Display the results.
- System.out.println("Authenticated: " + authed);
- //
- //
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement