Ad Widget

Collapse

Auth hook function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • limo
    Senior Member
    • Dec 2004
    • 192

    #1

    Auth hook function

    Please it would be great to have auth_hook function during login. This function, if defined in conf/zabbix.conf.php, would mangle username and assign groups. We could use it in conjunction with ldap auth. But can be used for any kind of (even external HTTP ) auth to do some username and groups mapping. (like shibboleth).

    Our primary usage is, that we have 10k students. And we want let them login inside and see some items or hosts. But we do not want to manualy configure 10k zabbix accounts. Much more better solution is , map all students into one zabbix account "student". It is not important if changes will be permanent or per session. It means zabbix can either create mapped account if it does not exist and assign groups for it. Or simply create "virtual", per-session user and rights.

    Example:
    Code:
    /**
     * $user - username given by user (if external auth is used, may be null and $PHP_AUTH_USER will be used inside)
     * $pass - pass given by user (if external auth is used, may be null and $PHP_AUTH_PW will be used inside)
     * return Array ("username" => "student", "groups" => Array ("Admins","Local Admins") );
     */
    function auth_hook($user,$pass) {
       ... connect to ldap using user and pass
       ... optionaly change username (all students will have one zabbix account "student")
       ... optionaly assign groups (from ldap groups)
    }
    Does somebody like this feature? Could be usefull for mapping many customers into virtual accounts too.
Working...