How can I initiate a SPNEGO negotiation in a C# .NET client once Kerberos token is obtained? RRS feed

  • Question

  • Hi,

    I am using SSPI to get Kerberos token. But the web service endpoint I'd like to use requires SPNEGO (Kerbreos AP-REQ, not the Kerberos token I just obtained from SSPI).

    Is there a way to initiate SPNEGO negotiation from an Http client (e.g. by setting credentials to default) and expecting the Http library to build AP-REQ itself after receiving 401 from the web service?

    Note: I have tested with a couple of Http classes and the SSPI library itself but in vain. If someone can narrow this down for me that'd be great.



    Thursday, November 28, 2019 4:42 PM


All replies

  • Hi Hisham7G,

    Thank you for posting here.

    Since this thread is related to SPNEGO, I don't suggest that you post it here. Therefore, I will move it to where is forum for forum to redirect it to the correct forum.

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 29, 2019 1:54 AM
  • Might try asking over here.





    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Friday, November 29, 2019 2:03 AM
  • Or for SPNEGO you could also ask here: https://sourceforge.net/projects/spnego/support

    Regards, Guido

    Friday, November 29, 2019 6:53 AM
  • Hi Timon, thanks for your reply. I don't actually agree though. My question is: "how to achieve something in C# .NET". It's definitely a C# .NET question. I for instance know how to do that in Java (the library to use). But what I am struggling with is the lack of libraries or examples in C# .NET, hence me posting here.

    Would you reconsider in this case?



    Friday, November 29, 2019 9:56 AM
  • Thanks Dave. Will have a look.

    Kind regards,


    Friday, November 29, 2019 9:58 AM
  • Thanks Guido. Will have a look. But the question is more about how to achieve what I want in C# .NET. So it's not a pure SPNEGO topic.

    Kind regards,


    Friday, November 29, 2019 9:59 AM