473,385 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

CNTLMAuthObject problem. Please Help.

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??
Nov 17 '05 #1
2 1343

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

"kackson" <ka*****@yahoo.com> wrote in message
news:90*************************@posting.google.co m...
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??

Nov 17 '05 #2
"Bogdan Crivat [MSFT]" <bo*****@online.microsoft.com> wrote in message news:<eI**************@TK2MSFTNGP11.phx.gbl>...
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.
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: newbie_mw | last post by:
Hi, I need urgent help with a novice problem. I would appreciate any advice, suggestions... Thanks a lot in advance! Here it is: I created a sign-up sheet (reg.html) where people fill in their...
11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
3
by: Spacy | last post by:
Am creating a HTML Report in asp.net. To save this report to excel on client-side, i write this code: Response.ContentType = "application/vnd.ms-excel" Response.AddHeader("content-disposition",...
0
by: Kurt Watson | last post by:
I’m having a different kind of problem with Hotmail when I sign in it says, "Web Browser Software Limitations Your Current Software Will Limit Your Ability to Use Hotmail You are using a web...
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
0
by: kackson | last post by:
Hi. I would like to access a webpage that requires NTLM authentication. My code is very simple: // BEGIN CAtlHttpClient client; CAtlNavigateData navData; #if 1
0
by: Srinivas M | last post by:
Hello, I am developing VC application (ATL), that communicates with web service, with NTLM authentication. following is the code sinppet i have, Auth Object derived from IAuthInfo to supply...
11
by: ASP newbie | last post by:
I cannot run my asp.net application in w2k server. But the program works fine under w2k professional. Can anyone tell me is there any difference in the settings? Many thanks.
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.