title: Setting Timeout Value for LDAP authentication at Spring Boot
body: <p>I use Spring LDAP authentication via:</p>
  
  <pre><code>auth
              .ldapAuthentication()
              .userSearchFilter("userPrincipalName={0}")
              .contextSource()
              .managerDn(ldapAuthenticationConfig.getManagerDn())
              .managerPassword(ldapAuthenticationConfig.getManagerPassword())
              .url(ldapAuthenticationConfig.getUrl());
  </code></pre>
  
  <p>However, it takes too much time at login page when LDAP server is unavailable. I want to learn whether I can login or not within a considerable time. </p>
  
  <p>Here is the dependency that I use:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-ldap&lt;/artifactId&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>How can I set a timeout value for LDAP authentication at Spring Boot?</p>