diff options
author | Stef Walter <stef@memberwebs.com> | 2006-05-10 17:31:32 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-05-10 17:31:32 +0000 |
commit | e593016a80ceee52b6e3244512ff4307f8c208fa (patch) | |
tree | 1c3d31e8175979443f00694834bcc10ece665826 /apache1x/mod_httpauth.c | |
parent | 70488f63f5caf792ea9bf75004a3ea7a43ab90a4 (diff) |
Add NTLM support.
Diffstat (limited to 'apache1x/mod_httpauth.c')
-rw-r--r-- | apache1x/mod_httpauth.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/apache1x/mod_httpauth.c b/apache1x/mod_httpauth.c index 2aa34b8..b399c5d 100644 --- a/apache1x/mod_httpauth.c +++ b/apache1x/mod_httpauth.c @@ -66,9 +66,11 @@ httpauth_context_t; #define AUTH_PREFIX_BASIC "Basic" #define AUTH_PREFIX_DIGEST "Digest" +#define AUTH_PREFIX_NTLM "NTLM" #define AUTH_TYPE_BASIC 1 << 1 #define AUTH_TYPE_DIGEST 1 << 2 +#define AUTH_TYPE_NTLM 1 << 3 #define AUTH_TYPE_ANY 0x0000FFFF #define HTTPAUTH_AUTHTYPE "HTTPAUTH" @@ -117,6 +119,8 @@ static const char* set_types(cmd_parms* cmd, void* config, const char* val) type = AUTH_TYPE_BASIC; else if(strcasecmp(val, AUTH_PREFIX_DIGEST) == 0) type = AUTH_TYPE_DIGEST; + else if(strcasecmp(val, AUTH_PREFIX_NTLM) == 0) + type = AUTH_TYPE_NTLM; else if(strcasecmp(val, "any")) type = AUTH_TYPE_ANY; else @@ -144,7 +148,7 @@ static const command_rec httpauth_cmds[] = { "HttpAuthHandler", set_handler, NULL, OR_AUTHCFG, TAKE1, "The handler that httpauthd should use to authenticate" }, { "HttpAuthTypes", set_types, NULL, OR_AUTHCFG, ITERATE, - "The types of authentiction allowed (Basic, Digest, ...)" }, + "The types of authentiction allowed (Basic, Digest, NTLM ...)" }, { "HttpAuthDigestDomain", set_domain, NULL, OR_AUTHCFG, RAW_ARGS, "The domain for which digest authentication is relevant" }, { NULL, NULL, NULL, 0, 0, NULL } @@ -412,6 +416,10 @@ int read_copy_headers(httpauth_context_t* ctx, int ccode, request_rec* r) !(ctx->types & AUTH_TYPE_DIGEST)) continue; + else if(strncasecmp(line, AUTH_PREFIX_NTLM, strlen(AUTH_PREFIX_NTLM)) == 0 && + !(ctx->types & AUTH_TYPE_NTLM)) + continue; + /* Only allow unknown if we don't have it */ else if(!(ctx->types & AUTH_TYPE_ANY)) continue; @@ -608,6 +616,11 @@ int write_request(httpauth_context_t* ctx, request_rec* r) const array_header* hdrs_arr; const table_entry* elts; + /* + * TODO: We need to use a valid connection id for + * NTLM connections to work properly. + */ + /* Send the request header to httpauthd */ t = ap_pstrcat(r->pool, "AUTH XXX ", r->method, " ", r->unparsed_uri, "\n", NULL); |