centreon / centreon-archived

Centreon is a network, system and application monitoring tool. Centreon is the only AIOps Platform Providing Holistic Visibility to Complex IT Workflows from Cloud to Edge.
https://www.centreon.com
GNU General Public License v2.0
578 stars 240 forks source link

[Centreon 22.10.1][API] Unable to connect using accounts where authentication source is LDAP #12065

Open qladriere opened 1 year ago

qladriere commented 1 year ago

BUG REPORT INFORMATION

Prerequisites

The opened issue, must be code related. GitHub is not meant for support. Feel free to check the CONTRIBUTING section for more details.

Versions

For the RPM based systems

-- Copy/Paste the result of the following command --

centreon-22.10.1-4.el7.centos.noarch
centreon-agent-client-ACC-22.04.05-0.el7.x86_64
centreon-auto-discovery-server-22.10.0-14.el7.centos.noarch
centreon-broker-22.10.0-16.el7.x86_64
centreon-broker-cbd-22.10.0-16.el7.x86_64
centreon-broker-cbmod-22.10.0-16.el7.x86_64
centreon-broker-core-22.10.0-16.el7.x86_64
centreon-broker-storage-22.10.0-16.el7.x86_64
centreon-central-22.10.1-4.el7.centos.noarch
centreon-clib-22.10.0-16.el7.x86_64
centreon-common-22.10.1-4.el7.centos.noarch
centreon-connector-22.10.0-16.el7.x86_64
centreon-connector-perl-22.10.0-16.el7.x86_64
centreon-connector-ssh-22.10.0-16.el7.x86_64
centreon-database-22.10.1-4.el7.centos.noarch
centreon-engine-22.10.0-16.el7.x86_64
centreon-engine-daemon-22.10.0-16.el7.x86_64
centreon-engine-extcommands-22.10.0-16.el7.x86_64
centreon-gorgone-22.10.0-13.el7.centos.noarch
centreon-gorgone-centreon-config-22.10.0-13.el7.centos.noarch
centreon-license-manager-22.10.0-5.el7.centos.noarch
centreon-license-manager-common-22.10.0-5.el7.centos.noarch
centreon-perl-libs-22.10.1-4.el7.centos.noarch
centreon-poller-22.10.1-4.el7.centos.noarch
centreon-pp-manager-22.10.0-6.el7.centos.noarch
centreon-trap-22.10.1-4.el7.centos.noarch
centreon-web-22.10.1-4.el7.centos.noarch
centreon-widget-engine-status-22.10.0-9.el7.centos.noarch
centreon-widget-global-health-22.10.0-9.el7.centos.noarch
centreon-widget-graph-monitoring-22.10.0-9.el7.centos.noarch
centreon-widget-grid-map-22.10.0-10.el7.centos.noarch
centreon-widget-hostgroup-monitoring-22.10.0-9.el7.centos.noarch
centreon-widget-host-monitoring-22.10.0-10.el7.centos.noarch
centreon-widget-httploader-22.10.0-9.el7.centos.noarch
centreon-widget-live-top10-cpu-usage-22.10.0-10.el7.centos.noarch
centreon-widget-live-top10-memory-usage-22.10.0-11.el7.centos.noarch
centreon-widget-servicegroup-monitoring-22.10.0-10.el7.centos.noarch
centreon-widget-service-monitoring-22.10.0-11.el7.centos.noarch
centreon-widget-single-metric-22.10.0-10.el7.centos.noarch
centreon-widget-tactical-overview-22.10.0-9.el7.centos.noarch

Operating System

RHEL7

Browser used

Version: 22.10.1

Additional environment details (AWS, VirtualBox, physical, etc.):

Description

When using the API (I tried with the command line API), I can't connect using an account which is not a local account. Indeed, by using an account retrieved via LDAP, it returns the following message : Unable to login, your password has expired.

Steps to Reproduce

  1. Make sure you have an account defined in Centreon and which is using LDAP to connect
  2. This account has proper rights (admin, access to API)
  3. Execute a command in the aim to query the API. For ex : /usr/share/centreon/bin/centreon -u -p -a POLLERLIST Result : it returns an error message : "Unable to login, your password has expired."
  4. Now change the "authentication source" to "Centreon" and add the same password linked to this user (if not stored already using LDAP)
  5. Execute a command in the aim to query the API. For ex : /usr/share/centreon/bin/centreon -u -p -a POLLERLIST Result : it works and returns the result of this command.

Next to that, before changing the "authentication source", you can try to connect in web interface with the same account in the aim to confirm it works and password is not expired.

Describe the received result

Unable to login, your password has expired.

Describe the expected result

Should be able to connect and return the command result.

Logs

PHP error logs

For version using PHP 7.2 or 7.3 on centOs 8 or PHP 8

tail -f /var/log/php-fpm/centreon-error.log
No entries in this log when executing the cmd

centreon-engine logs (if needed)

tail -f /var/log/centreon-engine/centengine.log
No entries in this log when executing the cmd

centreon-broker logs (if needed)

tail -f /var/log/centreon-broker/central-broker-master.log
No entries in this log when executing the cmd