I am getting the same error but I am using UID={user}
SslConfig sslConfig = new SslConfig(new AllowAnyTrustManager());
  sslConfig.setHostnameVerifier(new CertVerifier());

  ConnectionConfig connConfig = new 
ConnectionConfig("ldaps://ldapserver.com:636");
  connConfig.setSslConfig(sslConfig);
  DefaultConnectionFactory connectionFactory = new 
DefaultConnectionFactory(connConfig);
  
  SearchDnResolver dnResolver = new SearchDnResolver(connectionFactory);
  dnResolver.setBaseDn("ou=xxxx,ou=xxxx,o=xxxxx");
  dnResolver.setUserFilter("uid={user}");
  dnResolver.setSubtreeSearch(true);
  dnResolver.setAllowMultipleDns(true);
  BindAuthenticationHandler authHandler = new 
BindAuthenticationHandler(connectionFactory);
  Authenticator auth = new Authenticator(dnResolver, authHandler);
  AuthenticationResponse response = auth
    .authenticate(new AuthenticationRequest(username, new 
Credential(password), new String[] {"mail", "sn"}));
  System.out.println("response : " + response);
//  if (AuthenticationResultCode.DN_RESOLUTION_FAILURE == 
response.getAuthenticationResultCode()) {
//      throw new AuthenticationException(username + "  not found");
//    }
  if (response.getResult()) {
   System.out.println("authenticated");
   LdapEntry entry = response.getLdapEntry(); // read mail and sn attribute
   System.out.println("email : " + entry.getAttribute("mail"));
   System.out.println("sn : " + entry.getAttribute("sn"));
  } else {
    String msg = response.getMessage(); // read the failure message
     ResponseControl[] ctls = response.getControls(); // read any response 
controls
   System.out.println("authentication failed !!! with message : " + msg);
  }

The result is 
ResultCode=DN_RESOLUTION_FAILURE
The message is : DN cannot be null

thanks

Jacques

On Wednesday, January 18, 2017 at 7:57:30 PM UTC+2, Ben Branch wrote:
>
> Daniel,
>
>  
>
> Worked like a champ.  Many thanks!  Now onto trying to configure the rest 
> of the stuff!
>
>  
>
> Ben Branch
> UNIX/Linux Administrator
>
> University of Central Oklahoma
>
> ITIL Foundation v3, Network+, RHCE
>
> 100 N. University Drive, Box 122
>
> Edmond, OK 73034
>
> D: 405.974.2649 | M: 405.550.6804 | *bbr...@uco. <javascript:>edu* | 
> www.uco.edu
>
>  
>
> “I am wiser than this man, for neither of us appears to know anything 
> great and good; but he fancies he knows something, although he knows 
> nothing; whereas I, as I do not know anything, so I do not fancy I do. In 
> this trifling particular, then, I appear to be wiser than he, because I do 
> not fancy I know what I do not know.”  - Socrates
>
>  
>
> *From:* [email protected] <javascript:> [mailto:[email protected] 
> <javascript:>] *On Behalf Of *Daniel Fisher
> *Sent:* Wednesday, January 18, 2017 10:42 AM
> *To:* [email protected] <javascript:>
> *Subject:* Re: [cas-user] CAS 4.2.7 and Active Directory
>
>  
>
> On Wed, Jan 18, 2017 at 10:41 AM, Ben Branch <[email protected] <javascript:>> 
> wrote:
>
> #========================================
>
> # Authentication
>
> #========================================
>
> ldap.authn.searchFilter=sAMAccountName=%u
>
>  
>
>  
>
> Try ldap.authn.searchFilter=(sAMAccountName={user})
>
>  
>
> --Daniel Fisher
>
>  
>
> -- 
> - CAS gitter chatroom: https://gitter.im/apereo/cas
> - CAS mailing list guidelines: 
> https://apereo.github.io/cas/Mailing-Lists.html
> - CAS documentation website: https://apereo.github.io/cas
> - CAS project website: https://github.com/apereo/cas
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CAS Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAFC6YwTMsEUWXA0MsmUUsW4A-jmeAnKPjxssKaRn0W7nTa8W5Q%40mail.gmail.com
>  
> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAFC6YwTMsEUWXA0MsmUUsW4A-jmeAnKPjxssKaRn0W7nTa8W5Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

On Wednesday, January 18, 2017 at 7:57:30 PM UTC+2, Ben Branch wrote:
>
> Daniel,
>
>  
>
> Worked like a champ.  Many thanks!  Now onto trying to configure the rest 
> of the stuff!
>
>  
>
> Ben Branch
> UNIX/Linux Administrator
>
> University of Central Oklahoma
>
> ITIL Foundation v3, Network+, RHCE
>
> 100 N. University Drive, Box 122
>
> Edmond, OK 73034
>
> D: 405.974.2649 | M: 405.550.6804 | *bbr...@uco. <javascript:>edu* | 
> www.uco.edu
>
>  
>
> “I am wiser than this man, for neither of us appears to know anything 
> great and good; but he fancies he knows something, although he knows 
> nothing; whereas I, as I do not know anything, so I do not fancy I do. In 
> this trifling particular, then, I appear to be wiser than he, because I do 
> not fancy I know what I do not know.”  - Socrates
>
>  
>
> *From:* [email protected] <javascript:> [mailto:[email protected] 
> <javascript:>] *On Behalf Of *Daniel Fisher
> *Sent:* Wednesday, January 18, 2017 10:42 AM
> *To:* [email protected] <javascript:>
> *Subject:* Re: [cas-user] CAS 4.2.7 and Active Directory
>
>  
>
> On Wed, Jan 18, 2017 at 10:41 AM, Ben Branch <[email protected] <javascript:>> 
> wrote:
>
> #========================================
>
> # Authentication
>
> #========================================
>
> ldap.authn.searchFilter=sAMAccountName=%u
>
>  
>
>  
>
> Try ldap.authn.searchFilter=(sAMAccountName={user})
>
>  
>
> --Daniel Fisher
>
>  
>
> -- 
> - CAS gitter chatroom: https://gitter.im/apereo/cas
> - CAS mailing list guidelines: 
> https://apereo.github.io/cas/Mailing-Lists.html
> - CAS documentation website: https://apereo.github.io/cas
> - CAS project website: https://github.com/apereo/cas
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CAS Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAFC6YwTMsEUWXA0MsmUUsW4A-jmeAnKPjxssKaRn0W7nTa8W5Q%40mail.gmail.com
>  
> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAFC6YwTMsEUWXA0MsmUUsW4A-jmeAnKPjxssKaRn0W7nTa8W5Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/8b9c242d-de1f-40b0-bf68-487ea55dabfa%40apereo.org.

Reply via email to