I have implemented an RPC client in C# which uses GSS/SPNEGO authentication. I am trying to connect to the standard/Active Directory services (DRSAPI, SAMR etc...) on the server. The authentication works fine except when using Kerberos authentication and I've been struggling for 1 week now trying to troubleshoot the error.
The use cases are the following:
Samba NTLM => OK
Samba Kerberos => OK
Windows NTLM => OK
Windows (2012, 2016) Kerberos => KO
When trying Kerberos, the authentication to the KDC seems to work just fine, the ticket is obtained, but when trying to connect to the RPC service with the ticket (works on Samba), the server respond with a nca_s_fault_sec_pkg_error (again, only on Windows 2012) and I can't find what is rubbing Windows the wrong way. I am not an expert in Kerberos and there doesn't seem to be any entry in the event viewer. I compared Wireshark traces with a working and non working authentication and I can't see any differences.
Can someone please help me identify what the error is? Let me know if you need more information, I can provide Network traces and logs (samba, app, windows)
Here is a link to working (Samba) and non working (Windows 2012) wireshark traces of the exact same code with only the user password and the address of the server (Samba = 192.168.1.49 and W2K12 = 192.168.1.151) as differences
Thanks