brennerm / check-mk-web-api

Python library to talk to the Check_Mk Web API
https://brennerm.github.io/check-mk-web-api/
MIT License
53 stars 26 forks source link

Support Kerberos Auth #19

Closed chrisongthb closed 4 years ago

chrisongthb commented 4 years ago

Hi Max,

could you add support for Kerberos Authentication?

Best, Chris

brennerm commented 4 years ago

Hi @chrisongthb, currently I do not have enough time to work on this project. A PR for Kerberos Auth would be greatly appreciated anyway.

Cheers, Max

chrisongthb commented 4 years ago

After reading the manual and doing some tests I found out, that the API is not designed to work with Kerberos. It is supposed to work only with automation users (user:password).
On my test site cmk redirects me to the login page, whereas all other cmk sites work with that setting.

kerberosuser@linux: ~$ curl --negotiate -u : https://cmk.domain/mykerberizedsite/check_mk/webapi.py
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="/mykerberizedsite/check_mk/login.py?_origtarget=webapi.py">here</a>.</p>
</body></html>

The workaround for me is to use requests and kerberos python libraries and use the URI parameter "output_format=python".