Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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;
    }
}
share|improve this answer
    
Ok, that was the answer I was afraid of :\ –  Jaime Soriano Jan 20 '12 at 10:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.