* has been initialized for the client.
*/
ldapSession.putSaslProperty( SaslConstants.SASL_CREDS, tokenBytes );
}
LdapPrincipal ldapPrincipal = ( LdapPrincipal ) ldapSession
.getSaslProperty( SaslConstants.SASL_AUTHENT_USER );
if ( ldapPrincipal != null )
{
DirectoryService ds = ldapSession.getLdapServer().getDirectoryService();
String saslMechanism = bindRequest.getSaslMechanism();
byte[] password = null;
if ( ldapPrincipal.getUserPasswords() != null )
{
password = ldapPrincipal.getUserPasswords()[0];
}
CoreSession userSession = ds.getSession( ldapPrincipal.getDn(),
password, saslMechanism, null );
// Set the user session into the ldap session
ldapSession.setCoreSession( userSession );