String authzID = null;
BindRequest bindRequest =
new SimpleBindRequest("uid=test.user,ou=People,dc=example,dc=com",
"password", new AuthorizationIdentityRequestControl());
BindResult bindResult = connection.bind(bindRequest);
AuthorizationIdentityResponseControl authzIdentityResponse =
AuthorizationIdentityResponseControl.get(bindResult);
if (authzIdentityResponse != null)
{
authzID = authzIdentityResponse.getAuthorizationID();
}