Programatically accessing authentication backend info

Hello,

I am trying to access the auth backend to verify a user exists for an independent program but cannot figure it out. The data I want is what you get by browsing to to the Director -> Configuration -> Authentication -> Users tab, then clicking the user. Which gives a URL like so;

https://mon/icingaweb2/user/show?backend=icingaweb2&user=foobar

I am able to access the notification users hanging off /v1/objects/Users but the login users come from the backend, which I cannot figure out how to access.

Is this possible? It would save me a fair amount of effort if so. Thanks in advance.

That depends on the type of backend. Though, if you’re going to use PHP you can do it just like Icinga Web 2 does it. The code to access a backend there applies to all types of backends.

But if you’re not using PHP, you’d have to access the database/LDAP yourself.

Okay, thanks for your response. My backend is sql schema. I just wanted to double check it wasn’t available through an API (didn’t see it in icinga2 object list or director APIs) before I went down the DB route. I actually pre-create some users with sql anyway on initial install, so it’s not a big stretch.

I might toy around with some additional web programming but I am comfortable with DB stuff; the only reason I’d try web first is so my program doesn’t have extra deps and complexity.

My program takes alert emails via imaps and will ack them so we don’t have to login all the time, I just want to ensure the user who responded has a valid icingaweb login.