diff options
author | Pavel Březina <pbrezina@redhat.com> | 2017-02-28 13:58:20 +0100 |
---|---|---|
committer | Lukas Slebodnik <lslebodn@redhat.com> | 2017-03-30 19:08:05 +0200 |
commit | af026ea6a6e812b7d6c5c889dda64ba7b7c433ee (patch) | |
tree | e49e6c12b3a1a9a195c544443f1ff5e236d91257 | |
parent | 720e1a5b95a953a0f1c8315bbb7c9c1edf9fb417 (diff) | |
download | sssd-af026ea6a6e812b7d6c5c889dda64ba7b7c433ee.tar.gz sssd-af026ea6a6e812b7d6c5c889dda64ba7b7c433ee.tar.xz sssd-af026ea6a6e812b7d6c5c889dda64ba7b7c433ee.zip |
secrets: support HTTP basic authentication with proxy provider
Even though configuration options auth_type = basic, username and password
are read they were not used anywhere prior this patch.
Reviewed-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
-rw-r--r-- | src/responder/secrets/proxy.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/responder/secrets/proxy.c b/src/responder/secrets/proxy.c index 240a1de1e..fd96e985c 100644 --- a/src/responder/secrets/proxy.c +++ b/src/responder/secrets/proxy.c @@ -440,6 +440,15 @@ static errno_t proxy_http_create_request(TALLOC_CTX *mem_ctx, } } + /* Set basic authentication if required. */ + if (pcfg->auth_type == PAT_BASIC_AUTH) { + ret = tcurl_req_http_basic_auth(tcurl_req, pcfg->auth.basic.username, + pcfg->auth.basic.password); + if (ret != EOK) { + goto done; + } + } + talloc_steal(tcurl_req, body); *_tcurl_req = talloc_steal(mem_ctx, tcurl_req); |