{
retval = provider.generateChallenge( getLdapSession().getIoSession(), response );
}
catch ( Exception e )
{
throw new SaslException( I18n.err( I18n.ERR_668 ), e );
}
break;
case TYPE_3_RECEIVED:
boolean result;
try
{
result = provider.authenticate( getLdapSession().getIoSession(), response );
Dn dn = getBindRequest().getDn();
dn.apply( getLdapSession().getLdapServer().getDirectoryService().getSchemaManager() );
LdapPrincipal ldapPrincipal = new LdapPrincipal( getAdminSession().getDirectoryService()
.getSchemaManager(),
dn, AuthenticationLevel.STRONG );
getLdapSession().putSaslProperty( SaslConstants.SASL_AUTHENT_USER, ldapPrincipal );
getLdapSession()
.putSaslProperty( Context.SECURITY_PRINCIPAL, getBindRequest().getName().toString() );
}
catch ( Exception e )
{
throw new SaslException( I18n.err( I18n.ERR_669 ), e );
}
if ( !result )
{
throw new SaslException( I18n.err( I18n.ERR_670 ) );
}
break;
}