I have a c++ application which using NTLM authentication method (WinHttpSetOptio开发者_如何学Pythonn). what I'm trying to do is to set the credentials, meaning: the NTLM uath is using the logged on credentials, I want to provide him the credentials myself (in domain\user
format).
From the MSDN I see that the WinHttpSetCredentials
doesn't affect.
Can someone help me please?
Take a look at WinHttpSetOption
using WINHTTP_OPTION_AUTOLOGON_POLICY
.
http://msdn.microsoft.com/en-us/library/aa384066.aspx#WINHTTP_OPTION_AUTOLOGON_POLICY
If you set the value to WINHTTP_AUTOLOGON_SECURITY_LEVEL_HIGH
, then it stops WinHttp from providing default credentials and you can set it yourself when you receive the proper 401/407 response using WinHttpSetCredentials
.
精彩评论