Fast Bind

The fast bind extended operation allows an Active Directory server to process concurrent bind requests on the same connection. Successful binds do not perform authorization steps and the connection remains authorized as an anonymous user. Once the fast bind operation is performed it cannot be disabled and the operation must be performed before any other bind is attempted. Only simple binds are supported.

// use a format dn resolver
FormatDnResolver dnResolver = new FormatDnResolver("%s@ldaptive.org");

// use a pooled bind authentication handler
PooledConnectionFactory factory = new PooledConnectionFactory(ConnectionConfig.builder()
  .url("ldap://directory.ldaptive.org")
  .useStartTLS(true)
  .connectionInitializers(new FastBindConnectionInitializer())
  .build());
factory.initialize();

SimpleBindAuthenticationHandler authHandler = new SimpleBindAuthenticationHandler(factory);
Authenticator auth = new Authenticator(dnResolver, authHandler);
AuthenticationResponse response = auth.authenticate(
  new AuthenticationRequest("dfisher", new Credential("password")));
if (response.isSuccess()) { // authentication succeeded

} else { // authentication failed
  String msg = response.getDiagnosticMessage(); // read the failure message
}