When does a Windows client use Initiator preferred NegoEx for SPNEGO?
Asked Answered
C

0

6

Attempting to authenticate a windows client (IE/Firefox) via SPNEGO and Kerberos. The server side is Java/Tomcat with JCIFS for SPNEGO authentication. The SSO (Kerberos) auth works fine when hosting the server side on a Win 2008 R2 server. However, when on a 2012 server it fails with a GSSException: Defective token detected.

Digging a bit deeper with network tracing I found that, in the working case the IE client sends the negotiate tokens with 4 mechTypes :

  • 1.2.840.48018.1.2.2 - MS KRB5,
  • 1.2.840.113554.1.2.2 - KRB5,
  • 1.3.6.1.4.1.311.2.2.30 - NEGOEX, and
  • 1.3.6.1.4.1.311.2.2.10 - NTLMSSP

In this case my server side will complete the SPNEGO selecting MS KRB5. However, in the problem case, the IE client only sends token with 2 mechtypes - NEGOEX and NTLMSSP. And this is initiator preferred. Java doesn't support NEGOEX and hence it fails.

Some search revealed that this problem is associated with bugs in JDK*, or otherwise issues with DNS. However, I'm on latest JDK and DNS seems to be okay. So my question is, when does a browser in Windows switch to NEGOEX in SPNEGO and why ? The closest answer I found was in an msdn blog which says Kerberos is not available since it's not in a domain environment. However, the client is indeed in domain environment and klist shows a valid Kerberos ticket. If it indeed is a domain problem, what exactly could be the root cause, and how can I avoid the problem ?


  • Footnote, some background research information : JDK8 has seen many fixes in the GSS mechanism. There were things broken in jdk8u40 and jdk8u45. Then further fixes are present in jdku65. A bug report which was supposed to implement NEGOEX was closed with a fix

    "a fix to SPNEGO that allows NEGOEX be presented and bypassed"

    however, I'm not sure if NEGOEX is indeed working. The NEGOEX IETF standard also looks abandoned with the draft RFC in the expired state. So I doubt if it will really be supported by Java, libraries.

Channa answered 26/11, 2015 at 14:10 Comment(5)
Does your AD contain an account with a SPN of "HTTP/<servername-in-your-browser-addressbar>"?Underpants
Sure, it does. Which is why it works for the first case. It does have an SPN configured for both the servers.Channa
I started a bounty because I experienced the same problem; In my case, beside standard client (IE / Firefox) , I also and above concerned about to how to do (which&how configuration or API adopt) in the case of custom client ( dot net custom client built using microsoft frameworks such ad WCF o other microsoft libraries)Inflatable
Did you ever resolve this?Pelasgian
@Pelasgian Nope. I really don't know when NegoEx is send. I re-installed everything in a clean slate and created fresh SPN etc. Things were working after that. Most of these problems could be attributed to the SPN. I did have a valid SPN in the original case, but there could be other things like DNS/hostname etc.Channa

© 2022 - 2024 — McMap. All rights reserved.