473,890 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTP-auth workaround

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. In the "old days", aMemberPro then moved the user to a page inside a
directory protected with .htaccess basic authentication. It used the URL
format http://name:pa******@server.directory.page.html. When the IE6 update
came out, this syntax no longer worked.

As a workaround, the "name:password@ " was removed. Now, users have to login to
the aMemberPro page then login again to the protected content of the website.

I have access to the userid and password. Is there a way that I can set things
up right before the user is redirected to the server/directory/page.html
inside the protected directory so the web server's authentication will be
satisifed and the user will not be prompted again for userid/password?

I've tried plugging values for $_SERVER[remote_user], but I still get prompted
by the server for userid/password.

Thanks for any suggestions.
Jul 17 '05 #1
3 2289
Steven Stern wrote:
Here's the situation:

I have an exisiting system that first authenticates people via the aMemberPro
package. In the "old days", aMemberPro then moved the user to a page inside a
directory protected with .htaccess basic authentication. It used the URL
format http://name:pa******@server.directory.page.html. When the IE6 update
came out, this syntax no longer worked.

As a workaround, the "name:password@ " was removed. Now, users have to login to
the aMemberPro page then login again to the protected content of the website.

I have access to the userid and password. Is there a way that I can set things
up right before the user is redirected to the server/directory/page.html
inside the protected directory so the web server's authentication will be
satisifed and the user will not be prompted again for userid/password?

I've tried plugging values for $_SERVER[remote_user], but I still get prompted
by the server for userid/password.

Thanks for any suggestions.


One possibility is not to actually direct over there. Use a wrapper
script to get the page content and display it based on the user/pass
already used.

For instance, write a script that does something like:

readfile('http://'.$username.':' .***********@ww w.example.com/dir/file.html');

So what you'd do is redirect to this page, get the user/pass, add it to
the above line, and end the script. If you want the user to click
through links in the pages there, your best bet is to have them just log
in a second time...

Hmm... a better solution is to use the Basic Auth as the login in the
first place, even if you want to use PHP to do it:

http://us2.php.net/features.http-auth

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Jul 17 '05 #2
On Tue, 27 Apr 2004 18:25:45 GMT (more or less), Justin Koivisto
<sp**@koivi.com > wrote:
Hmm... a better solution is to use the Basic Auth as the login in the
first place, even if you want to use PHP to do it:

http://us2.php.net/features.http-auth


That's where I started. I may yet wind up re-writing things so I get the
id/psw, check it against aMember's database, then go on with the http-auth
login. My hope is that I can do this with the minumum modification to
existing code. It's a website I inherited and I don't have a complete
understanding (yet) of how the aMember system works.
Jul 17 '05 #3
Steven Stern wrote:
I'm looking for a way to force basic http autentication from within a PHP
script.


And here it is
http://www.php.net/manual/en/features.http-auth.php
Jul 17 '05 #4

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

Similar topics

13
4136
by: Wolfgang May | last post by:
Hi, I have a problem with the HTTP implementation of the PEAR package: I try to PUT an XML instance to an XML database (eXist), but it always puts a binary: <?php require_once "HTTP/Request.php"; $URL = 'http://ap34.ifi.informatik.uni-goettingen.de:8081/exist/servlet/db/may/hamlet.xml';
8
2236
by: ben | last post by:
I'm trying to write a web client script in python to log onto a web page and pull some information off of it. The page has quite a few behind the scenes http things going on that are making it difficult to write the python script. I think if I could see the raw http data that comes to my browser life would be much easier. Does anybody know of programs that would run alongside my browser and show the http data that is send back and...
8
10664
by: turnit \(removethis\) | last post by:
I have a login form that uses the post method to carry the information to the next page. The form works just fine in ie6.0, but fails in mozilla and fails in ie5.2 on a mac. "HTTP/1.1 400 Bad Request" was the original error msg now that I reinstalled iislockdown and urscan I get "The parameter is incorrect." If I use the get method with this form it works just fine on everything. I can't say for certain but I think this problem started...
3
5413
by: ashesdesign | last post by:
Hi All, I am very new to php and even newer to XML. Can anyone please shed some light on how to post XML requests via HTTP. I have been searching high and low and have come across many examples and snippets, but none work nor make sense to me. Below is an example of what it is I need to send as a request and the typical example I should receive. I just don't know how to send the request!!! A Request
5
10405
by: David Lozzi | last post by:
Howdy, I wrote a web service in .Net for my customer. My customer has another vendor who now has to consume it but they are not using Visual Studio. Most of their pages are jsp, and they said they need to consume this web service using HTTP. The developer's IDE is Notepad. Yeah, weird I know. How is this done? I guess if I can get it to run ASP, IDE independant, that should make them happy. Any references you can point me to?
4
2490
by: Bob Badger | last post by:
Hi, Simple question (although I guess with a complicated answer). Is HTTP an async protocol? For instance, if I send a message to a c# webservice via http what is the protocol actually doing? Thanks in advance Steffan
1
4298
by: zpinhead | last post by:
I am unable to get my downloaded extension from pecl to link up with php properly. seems like the php.so I could not use pear install http. pear claimed the extension was already installed. that is certainly not true. I downloaded the http extension from pecl. cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/http
3
2162
by: webEater | last post by:
Hey, I am writing a file that reads in an external file in the web and prints it out including the response header of the http protocol. I do this to enable cross domain XMLHttpRequests. I implemented it via fsockopen, like this: <? $url = $_REQUEST; // take the param as $uri //... more ...
1
1960
by: rpjd | last post by:
I am completely new to this so please bear with me here. My project involves a webpage executing php scripts via an xmlhttprequest which queries a database and returns data to the webpage. This code below is working to a degree in IE7. As I have not yet parsed http.responseText, I am getting all the code in parts.php in the alert. My php script query creates two php arrays, one a single array and a two-dimensional array such as array. My...
1
2270
by: rpjd | last post by:
I am having a problem getting the http.status of an xmlhttprequest. The request readystate has come back as readystate 4, but then it stops without confirming the http.status. Any help appreciated. <script type="text/javascript" > var postring = "?"; function string() { var first = document.numbers.first.value; var second = document.numbers.second.value; var third = document.numbers.third.value;
0
11234
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10828
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10467
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9638
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8018
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7171
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6052
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.