2

I have some users in a LDAP directory and I'd like to have another user in a plain or htpasswd file that can login although the connection with the LDAP server is not available.

Is it possible to have multiple authentication backends for the same host in lighttpd?

Jaime Soriano
  • 308
  • 3
  • 15

1 Answers1

1

Unfortunately, no; the auth.backend configuration as written only supports being configured for the exact strings of the 4 backend types; there doesn't seem to be any mechanism for fallback to another method.

if (!buffer_is_empty(s->auth_backend_conf)) {
    if (buffer_is_equal_string(s->auth_backend_conf, CONST_STR_LEN("htpasswd"))) {
        s->auth_backend = AUTH_BACKEND_HTPASSWD;
    } else if (buffer_is_equal_string(s->auth_backend_conf, CONST_STR_LEN("htdigest"))) {
        s->auth_backend = AUTH_BACKEND_HTDIGEST;
    } else if (buffer_is_equal_string(s->auth_backend_conf, CONST_STR_LEN("plain"))) {
        s->auth_backend = AUTH_BACKEND_PLAIN;
    } else if (buffer_is_equal_string(s->auth_backend_conf, CONST_STR_LEN("ldap"))) {
        s->auth_backend = AUTH_BACKEND_LDAP;
    } else {
        log_error_write(srv, __FILE__, __LINE__, "sb", "auth.backend not supported:", s->auth_backend_conf);

        return HANDLER_ERROR;
    }
}
Shane Madden
  • 114,520
  • 13
  • 181
  • 251