?
Solved

Getting password protected page with CHttpConnection

Posted on 1997-07-17
5
Medium Priority
?
322 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
[X]
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
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 600 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

764 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