473,473 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HTTP Auth problem

I want to access a page on a remote webserver that is protected by
HTTP authenticate (username and password box) that appears when you go
to the page.

I know that you can do this (using PHP or CGI) but I'm not sure how to
do this in asp.

An example of a page that does do this (just to prove I'm not talking
rubbish) is: http://web-sniffer.net/index.php which does exactly what
I'm on about.

I know how to do this in PHP using:

if ($PHP_AUTH_USER != "user"
or $PHP_AUTH_PW != "pass"):
// Bad or no username/password.
// Send HTTP 401 error to make the
// browser prompt the user.
header("WWW-Authenticate: " .
"Basic realm=\"Protected Page: " .
"Enter your username and password " .
"for access.\"");
header("HTTP/1.0 401 Unauthorized");

But how do I do this in Classic ASP? I'm assuming that i've got to set
the headers when I go to get the page but how?

Regards

Neil
Jul 22 '05 #1
1 1281
Take a look here for how to access the remote site.
http://www.aspfaq.com/show.asp?id=2173

Now, to adapt that for authentication, try:

XMLHTTP.Open "Get", URL, False, "username", "password"
'not tested

Ray at work

"Neil Hitchmough" <nh*********@yahoo.co.uk> wrote in message
news:6f**************************@posting.google.c om...
I want to access a page on a remote webserver that is protected by
HTTP authenticate (username and password box) that appears when you go
to the page.

I know that you can do this (using PHP or CGI) but I'm not sure how to
do this in asp.

An example of a page that does do this (just to prove I'm not talking
rubbish) is: http://web-sniffer.net/index.php which does exactly what
I'm on about.

I know how to do this in PHP using:

if ($PHP_AUTH_USER != "user"
or $PHP_AUTH_PW != "pass"):
// Bad or no username/password.
// Send HTTP 401 error to make the
// browser prompt the user.
header("WWW-Authenticate: " .
"Basic realm=\"Protected Page: " .
"Enter your username and password " .
"for access.\"");
header("HTTP/1.0 401 Unauthorized");

But how do I do this in Classic ASP? I'm assuming that i've got to set
the headers when I go to get the page but how?

Regards

Neil

Jul 22 '05 #2

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

Similar topics

3
by: Steven Stern | last post by:
I'm looking for a way to force basic http autentication from within a PHP script. Here's the situation: I have an exisiting system that first authenticates people via the aMemberPro package....
4
by: jsWalter | last post by:
I have an extension Class to Auth and I'm looking for some folks to hammer on it a bit and give feed back. Class: AuthUser - add user (well, Auth does that now, so its gone) - remove user...
7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
3
by: John Reese | last post by:
Hello there. I've run into some missing functionality with HTTP Digest authentication in the 2.3 library and I was wondering if I'm just missing something. Missing functionality the first:...
0
by: ramas | last post by:
Hi, I am new to PHP scripting and i am trying to connect to a soap server (as mentioned below) using the SOAP extension comesup with PHP. Now my requirement is to add my HTTP header fields along...
0
by: Ciaran McAuliffe | last post by:
Hey, I have a bit of a tricky problem, here is a quick overview. I have a website which connects to a webservice, this web service is a front for access to the Reporting Services Web Service, the...
4
by: 23s | last post by:
I had this problem in the past, after a server reformat it went away, and now after another server reformat it's back again - no clue what's doing it. Here's the flow: Website root is public, no...
3
by: Thomas.Firnschrott | last post by:
i have a problem concerning a php script i worte some time ago. It is a rather simple thing. On a Site you login via a html form which points to a php that checks the username and password, and...
1
by: kevin bailey | last post by:
I have used the PEAR Auth package to successfully set up authentication. <code> // Details of where the authentication details are stored. $options = array( 'dsn'...
3
by: hakan | last post by:
I've started playing with the Auth module, and I have a quick question before I go any deeper. Is it possible to embedd the Auth login form in an HTML page? I would like to put a login form in a...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.