CNTLMAuthObject problem. Please Help.

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??
 
B

Bogdan Crivat [MSFT]

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
 
K

kackson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top