CNTLMAuthObject problem. Please Help.

  • Thread starter Thread starter kackson
  • Start date Start date
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??
 
The default constructor for the CNTLMAuthObject uses the currently logged
user and it does not need a user name or a password.

Does the web site support Basic authentication?
The user name/password from AuthData are used for the "BASIC" authentication
scheme.

--
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. It is for newsgroup
purposes only.

thanks,
bogdan
 
Bogdan Crivat said:
The default constructor for the CNTLMAuthObject uses the currently logged
user and it does not need a user name or a password.

Does the web site support Basic authentication?
The user name/password from AuthData are used for the "BASIC" authentication
scheme.

Hi. Is it possible to change the default setting so that it can accept
and use the password and user name that I provide? Since my
application may be open to more than one user on the same terminal, I
would like the users be authenticated with the password and username.
But, at the same time, I dont want to use basic authentication since
the password would be sent in plain text form. Is there anyway I could
change the constructor so that it accept and use the password I
supply? Deeply appreciate any pointers.
 
Back
Top