diff --git a/app/assets/javascripts/app/controllers/_integration/ldap.coffee b/app/assets/javascripts/app/controllers/_integration/ldap.coffee index b497b0f05..dc0bbbdef 100644 --- a/app/assets/javascripts/app/controllers/_integration/ldap.coffee +++ b/app/assets/javascripts/app/controllers/_integration/ldap.coffee @@ -287,12 +287,13 @@ class ConnectionWizard extends App.WizardModal option = '' options = {} - for dn in data.attributes.namingcontexts - options[dn] = dn - if option is '' - option = dn - if option.length > dn.length - option = dn + if !_.isEmpty data.attributes + for dn in data.attributes.namingcontexts + options[dn] = dn + if option is '' + option = dn + if option.length > dn.length + option = dn @wizardConfig.options = options @wizardConfig.option = option diff --git a/app/controllers/integration/ldap_controller.rb b/app/controllers/integration/ldap_controller.rb index ff91b292f..16d2393fb 100644 --- a/app/controllers/integration/ldap_controller.rb +++ b/app/controllers/integration/ldap_controller.rb @@ -14,12 +14,21 @@ class Integration::LdapController < ApplicationController attributes: ldap.preferences, } rescue => e - logger.error e + # workaround for issue #1114 + if e.message.end_with?(', 48, Inappropriate Authentication') + result = { + result: 'ok', + attributes: {}, + } + else + logger.error e + result = { + result: 'failed', + message: e.message, + } + end - render json: { - result: 'failed', - message: e.message, - } + render json: result end def bind