Solved

Getting password protected page with CHttpConnection

Posted on 1997-07-17
5
315 Views
Last Modified: 2013-11-20
Hi, I have been experimenting with a program to download webpages, based on the MFC 'Tear' sample app. How do I get this program to submit a username and password for a protected page. (It uses CHttpConnection and CHttpFile to retrieve the web-page)
0
Comment
Question by:johand
5 Comments
 
LVL 4

Expert Comment

by:mbhakta
ID: 1302635
Are you talking about the login dialog box which pop's up when you try connecting to your Nprovider ?
0
 

Author Comment

by:johand
ID: 1302636
No, I would like to retrieve a page that requires a CGI (I think) posted username and password before you can download the page. When I do a HTTP_VERB_GET, the return value of QueryInfoStatusCode is HTTP_STATUS_DENIED, and the 'Tear' sample then mentions sending a username/password to retrieve this page.

But how do you do that ?

(Sorry of this is a bit vague, I'm still a bit new to internet programming ;) )
0
 
LVL 3

Expert Comment

by:jaba
ID: 1302637
Username and password implemented not by CGI script. When you opening HTTP file it look like you opening ordinar file on remote computer.  Password and username required tfor the SERVER security system ( usially it file system ). So , not worry about it :-(

0
 

Author Comment

by:johand
ID: 1302638
This MUST be possible programmatically, because offline browsers  (such as GotIt etc) ask you to specify a username/password for a webpage (if it requires one) to download the page in the background.
0
 
LVL 3

Accepted Solution

by:
vinniew earned 200 total points
ID: 1302639
That information is passed on a different port.  Try using port 443.  Usually web servers use 1080 for http stuff.

I suppose you'd have to listen to port 443 for activity, and then respond.  Check out the RFC for *exacting* details.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error on moodle after upgrade 3 123
viewing source code from eclipse 13 89
centeredAverage challenge 8 132
firstChar challenge 13 110
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now