I have a problem with the icinga Director API. When I want to connect to the director via API as described on Rest Api - Icinga Director I receive the message 401 Unauthorized.
I created a API user with permissions = [ “*” ]
OS: CentOS 8.4.2105
apache: Apache/2.4.37 (centos)
PHP: PHP 7.2.24 (fpm-fcgi)
icinga director: 1.8.0
The Output with -vvv is
Note: Unnecessary use of -X or --request, GET is already inferred. * Trying ::1... * TCP_NODELAY set * Connected to localhost (::1) port 80 (#0) * Server auth using Basic with user 'apiuser' > GET /icingaweb2/director/host?name=icinga01 HTTP/1.1 > Host: localhost > Authorization: Basic ****************************= > User-Agent: curl/7.61.1 > Accept: application/json > < HTTP/1.1 401 Unauthorized < Date: Tue, 03 Aug 2021 06:55:01 GMT < Server: Apache/2.4.37 (centos) OpenSSL/1.1.1g < X-Powered-By: PHP/7.2.24 * Authentication problem. Ignoring this. < Www-Authenticate: Basic realm="Icinga Web 2" < Content-Length: 0 < Content-Type: text/html; charset=UTF-8 < * Connection #0 to host localhost left intact
I have seen the Issue on github API - 401 Unauthorized · Issue #1362 · Icinga/icingaweb2-module-director · GitHub
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
is set in the “apache >= 2.4” section of /etc/httpd/conf.d/icingaweb2.conf.
I have no idea, where to search to solve the issue.
Thanks a lot