WinHTTP Unable to send authentication credentials RRS feed

  • Question

  • Hello,

    I have a C++ application that needs to hit an .asmx page using NT Authentication. I am using WinHTTP, not WinInet to take care of everything.

    The server sends back NTLM and Negotiation authentication headers.   I perform code similar to what is shown in "Authentication in WinHTTP":  http://msdn.microsoft.com/en-us/library/windows/desktop/aa383144%28v=vs.85%29.aspx

    I would like to be able to use my Application Pool Identity and have credentials passed up to the server for authentication.


    Currently, the only time I can get it to properly authenticate is if I manually enter the username and password and pass them into WinHttpSetCredentials.

    There has to be a way to have it do automatic NT Authentication, right?

    Thank you.

    • Edited by Potato Chip Thursday, July 25, 2013 11:01 PM
    Thursday, July 25, 2013 10:29 PM

All replies

  • Update:

    I got it to pass up and work now.   It seems if you set the auto logon option, you shouldn't try setting any credentials because it interferes.   I guess that makes sense.  

    now, with SSL, I seem to have an issue where it's not passing up the servername when I make the request.  

    instead of seeing "servername:443" in Fiddler when the request goes up, I see things like:


    I am fairly new to WinHttp and am used to WinInet sort of doing a lot of this under the covers.  I'm assuming I am missing some option or setting I need to set manually.


    Friday, July 26, 2013 5:13 PM