bindResponse = ldapConnection.bind( digestMd5Request );
}
// GSSAPI Authentication
else if ( connection.getConnectionParameter().getAuthMethod() == ConnectionParameter.AuthenticationMethod.SASL_GSSAPI )
{
SaslGssApiRequest gssApiRequest = new SaslGssApiRequest();
Preferences preferences = ConnectionCorePlugin.getDefault().getPluginPreferences();
boolean useKrb5SystemProperties = preferences
.getBoolean( ConnectionCoreConstants.PREFERENCE_USE_KRB5_SYSTEM_PROPERTIES );
String krb5LoginModule = preferences
.getString( ConnectionCoreConstants.PREFERENCE_KRB5_LOGIN_MODULE );
if ( !useKrb5SystemProperties )
{
gssApiRequest.setUsername( bindPrincipal );
gssApiRequest.setCredentials( bindPassword );
gssApiRequest.setQualityOfProtection( connection
.getConnectionParameter().getSaslQop() );
gssApiRequest.setSecurityStrength( connection
.getConnectionParameter()
.getSaslSecurityStrength() );
gssApiRequest.setMutualAuthentication( connection
.getConnectionParameter()
.isSaslMutualAuthentication() );
gssApiRequest
.setLoginModuleConfiguration( new InnerConfiguration(
krb5LoginModule ) );
switch ( connection.getConnectionParameter().getKrb5Configuration() )
{
case FILE:
gssApiRequest.setKrb5ConfFilePath( connection.getConnectionParameter()
.getKrb5ConfigurationFile() );
break;
case MANUAL:
gssApiRequest.setRealmName( connection.getConnectionParameter()
.getKrb5Realm() );
gssApiRequest.setKdcHost( connection.getConnectionParameter()
.getKrb5KdcHost() );
gssApiRequest.setKdcPort( connection.getConnectionParameter()
.getKrb5KdcPort() );
break;
}
}