protected BindOperationContext doBindOperation( Dn bindDn, byte[] credentials, String saslMechanism,
String saslAuthId ) throws Exception
{
BindOperationContext bindContext = new BindOperationContext( null );
bindContext.setDn( bindDn );
bindContext.setCredentials( credentials );
bindContext.setSaslMechanism( saslMechanism );
bindContext.setSaslAuthId( saslAuthId );
bindContext.addRequestControls( convertControls( true, requestControls ) );
bindContext.setInterceptors( getDirectoryService().getInterceptors( OperationEnum.BIND ) );
OperationManager operationManager = service.getOperationManager();
operationManager.bind( bindContext );
requestControls = EMPTY_CONTROLS;
responseControls = JndiUtils.toJndiControls( getDirectoryService().getLdapCodecService(),
bindContext.getResponseControls() );
return bindContext;
}