Automation user authentication for REST API calls

Hello,

I’m trying to authenticate the pre-configured automation user for REST calls as follows:

curl ‘http://hostname/mysite/check_mk/api/1.0/version?_username=automation&_secret=7a3a73fe-ab15-4279-9195-1c7540aca69c

But get the following response:

{“title”: “You need to be authenticated to use the REST API.”, “status”: 401}

Is it possible to authenticate with the username/secret URL param method for REST API calls? If so, what could I be missing?

Note that Web API calls using the same authentication method works fine, for example:

curl ‘http://hostname/mysite/check_mk/view.py?_username=automation&_secret=7a3a73fe-ab15-4279-9195-1c7540aca69c&view_name=svcproblems&output_format=json’;

Thanks!

Please read the REST API documentation. It does not use the credentials in URL parameters but in a HTTP Authorization header.

Thanks. The HTTP Authorization header works ok with REST API but after reading Users, roles and permissions - Authorization and user configuration I was expecting username/secret URL param to work too and I quote…

When connecting Checkmk to other systems it is often desired that specific tasks normally performed using the GUI be automated. Some examples of these are:

  • Managing hosts with the REST-API

    To simplify this procedure Checkmk offers the concept of the Automation user. These users are intended exclusively for remote control and don’t permit normal GUI logins. Authorisation is achieved using specific variables in the URL.

Thanks!

The page Users, roles and permissions - Authorization and user configuration still talks about the old WATO-API here. Maybe the text should be changed, @martin.hirschvogel?

Changed already I guess

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.