Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Getting password protected page with CHttpConnection

Posted on 1997-07-17
5
317 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 42
Expand LInux Boot partition remotly 3 96
unable to delete all specified values regedit 38 546
"Black Box" Testing of Control System Software 2 70
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

839 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