I can successfully run kinit to get following klist output:
Ticket cache: FILE:/tmp/krb5cc_1001
Default principal: [email protected]
Valid starting Expires Service principal
01.03.2022 17:24:01 02.03.2022 17:23:58 krbtgt/[email protected]
and the following cURL command also works:
curl --negotiate -u: http://test.kerim.io:8081/skin?test=foo
with the following output:
* Connected to test.kerim.io (192.168.1.100) port 8081 (#0)
* Server auth using Negotiate with user '';
> GET /skin?test=foo HTTP/1.1
> Host: test.kerim.io:8081
> Authorization: Negotiate YIICWQYGKwYBBQUCoIIC[redacted]
> User-Agent: curl/7.74.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Tue, 01 Mar 2022 16:29:15 GMT
< Server: Apache
< WWW-Authenticate: Negotiate oYG3MIG0oAMKAQChCwYJKoZIgvcSA[redacted]
< Cache-Control: no-cache, no-store
< Access-Control-Allow-Origin: localhost
< Access-Control-Allow-Methods: GET, POST, OPTIONS
< Access-Control-Max-Age: 1000
< Access-Control-Allow-Headers: X-Requested-With, Content-Type, Origin, Authorization, Accept
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=UTF-8
I tried setting all sorts of browser settings in firefox (via about:config, following this guide) and chrome's command line arguments (--auth-server-whitelist="*.kerim.io"), but it seems as though the browsers just refuse to negotiate for the above mentioned URL.
The client OS is Ubuntu. The webserver does respond with WWW-Authenticate: Negotiate.
Calling Firefox with the following env variables:
export NSPR_LOG_MODULES="negotiateauth:5,NTLM:5" KRB5_TRACE="/dev/stderr"
shows this error:
[Parent 21580: Main Thread]: D/negotiateauth service = test.kerim.io
[Parent 21580: Main Thread]: D/negotiateauth using negotiate-gss
[Parent 21580: Main Thread]: D/negotiateauth entering nsAuthGSSAPI::nsAuthGSSAPI()
[Parent 21580: Main Thread]: D/negotiateauth Attempting to load gss functions
[Parent 21580: Main Thread]: D/negotiateauth entering nsAuthGSSAPI::Init()
[Parent 21580: BgIOThreadPool #1]: D/negotiateauth nsHttpNegotiateAuth::GenerateCredentials() [challenge=Negotiate]
[Parent 21580: BgIOThreadPool #1]: D/negotiateauth entering nsAuthGSSAPI::GetNextToken()
[Parent 21580: BgIOThreadPool #1]: D/negotiateauth gss_init_sec_context() failed: Unspecified GSS failure. Minor code may provide more information
SPNEGO cannot find mechanisms to negotiate
[Parent 21580: BgIOThreadPool #1]: D/negotiateauth leaving nsAuthGSSAPI::GetNextToken [rv=80004005]
Could this be a problem with the name resolution of the KDC? I currently have the hostname only in my /etc/hosts and not registered with the DNS.