K
kackson
Hi.
I would like to access a webpage that requires NTLM authentication. My
code is very simple:
// BEGIN
CAtlHttpClient client;
CAtlNavigateData navData;
#if 1
CNTLMAuthObject authObject;
client.AddAuthObj("NTLM", &authObject);
#else
CNTLMAuthObject authObject;
AuthData authData; // inquire user for username, password and domain
name
client.AddAuthObj("NTLM", &authObject, &authData);
#endif
client.NegotiateAuth(false);
client.Navigate( "http://localhost/Examples/simple.aspx", &navData );
int status = client.GetStatus();
client.Close();
// END
I always get access denied 401 error whenever I use the #else part of
the code. But I would be able to access without problem if I use the
#if 1 part of the code. I dont understand why. My authData contains
the same username, password, and domain as the one I use to logon to
my windows machine. What am I missing??
I would like to access a webpage that requires NTLM authentication. My
code is very simple:
// BEGIN
CAtlHttpClient client;
CAtlNavigateData navData;
#if 1
CNTLMAuthObject authObject;
client.AddAuthObj("NTLM", &authObject);
#else
CNTLMAuthObject authObject;
AuthData authData; // inquire user for username, password and domain
name
client.AddAuthObj("NTLM", &authObject, &authData);
#endif
client.NegotiateAuth(false);
client.Navigate( "http://localhost/Examples/simple.aspx", &navData );
int status = client.GetStatus();
client.Close();
// END
I always get access denied 401 error whenever I use the #else part of
the code. But I would be able to access without problem if I use the
#if 1 part of the code. I dont understand why. My authData contains
the same username, password, and domain as the one I use to logon to
my windows machine. What am I missing??