{"id":548,"date":"2012-02-26T08:43:59","date_gmt":"2012-02-26T13:43:59","guid":{"rendered":"http:\/\/crschmidt.net\/blog\/?p=548"},"modified":"2012-02-26T08:43:59","modified_gmt":"2012-02-26T13:43:59","slug":"kerberos-safari-support-or-lack-thereof-cnames-negotiate-auth","status":"publish","type":"post","link":"https:\/\/crschmidt.net\/blog\/archives\/548\/kerberos-safari-support-or-lack-thereof-cnames-negotiate-auth\/","title":{"rendered":"Kerberos Safari Support (or lack thereof): CNAMEs + Negotiate Auth"},"content":{"rendered":"<p>MetaCarta used Kerberos for single-sign-on support company wide.<\/p>\n<p>Now, given that MetaCarta was a bunch of MIT hackers, this shouldn&#8217;t be particularly shocking. \ud83d\ude42 It was generally a very nice thing to have &#8212; although it got me used to the idea that I *shouldn&#8217;t* type my password 20 times per day, a notion that Nokia has tried very hard to dissuade me from. <\/p>\n<p>However, Kerberos support in Safari never worked for MetaCarta&#8217;s web services. It was never clear to me why, it was just clear that it didn&#8217;t work. Googling showed me many people saying it did work, and no people saying it didn&#8217;t, so I figured it was some quirk of my system and didn&#8217;t bother to fix it.<\/p>\n<p>Now, at Nokia, I&#8217;m in the same boat: for services run by the Group Formerly Known as MetaCarta, we use Kerberos for everything. The difference is, falling back to Basic auth &#8212; which was fine in MetaCarta times &#8212; is a Very Expensive path to take in the new world; our auth services are slow Microsoft AD services hosted thousands of miles away on the other side of multiple high-latency firewalls, so when Kerberos doesn&#8217;t work &#8212; it hurts. <\/p>\n<p>So, after getting fed up with this behavior yesterday, I started digging in. I didn&#8217;t make a lot of progress last night, but this morning, I stumbled across <a href=\"https:\/\/discussions.apple.com\/thread\/2414517\">a post documenting that Safari does not work with hosts that are CNAMEs<\/a>. With that one small pointer, I found <a href=\"http:\/\/old.nabble.com\/server-referrals-td23409015.html\">other evidence<\/a> of people running into this, and an option to reproduce the Safari-like behavior in chrome: &#8220;&#8211;disable-auth-negotiate-cname-lookup&#8221;. (The option documentation points to HttpAuthHandlerNegotiate::CreateSPN in <a href=\"http:\/\/chromium-browser.sourcearchive.com\/documentation\/5.0.375.127~r55887-1\/http__auth__handler__negotiate__win_8cc-source.html\">http auth handler<\/a> for more details.)<\/p>\n<p>This bad behavior isn&#8217;t limited to Safari though: <a href=\"http:\/\/blog.michelbarneveld.nl\/michel\/archive\/2009\/11\/14\/the-reason-why-kb911149-and-kb908209-are-not-the-soluton.aspx\">different versions of IE and the .Net framework also fail<\/a> in similar ways at times. (The article in question says &#8220;Do not use CNAME dns records and non default web ports when using Kerberos!&#8221; &#8212; and given the multitude of clients and differing bugs in implementation, I&#8217;d say that seems like about the right approach.)<\/p>\n<p>This seems to be a bug in Safari; it isn&#8217;t clear to me if it&#8217;s also a bug in WebKit. A brief (30 minutes) search through webkit and related postings seems to indicate that the higher level authentication handlers &#8212; like the one linked above in Chrome &#8212; are implemented at the application level, not the library level. (The library provides the hooks, but wouldn&#8217;t have anything more complex like Kerberos &#8212; which isn&#8217;t surprising.) I think that would mean this is a bug in the Safari implementation &#8212; the closed source side that I can&#8217;t touch &#8212; rather than in the open source WebKit base, so I can&#8217;t just &#8216;fix it myself&#8217; (other than writing my own application layer &#8212; or more realistically, switching away from Safari to Chrome).<\/p>\n<p>Anyway, if you&#8217;re having an issue with Negotiate auth not working in Safari, when you think it should &#8212; check if the server you&#8217;re trying to talk to is using a CNAME. If the answer is yes, it seems you&#8217;ve run into a known limitation: Safari Just Doesn&#8217;t Do That.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MetaCarta used Kerberos for single-sign-on support company wide. Now, given that MetaCarta was a bunch of MIT hackers, this shouldn&#8217;t be particularly shocking. \ud83d\ude42 It was generally a very nice thing to have &#8212; although it got me used to the idea that I *shouldn&#8217;t* type my password 20 times per day, a notion that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-548","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/548","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/comments?post=548"}],"version-history":[{"count":0,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/548\/revisions"}],"wp:attachment":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/media?parent=548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/categories?post=548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/tags?post=548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}