Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 11th, 2003, 08:46 PM
mmarkin's Avatar
mmarkin mmarkin is offline
Russian Brains
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Location: Waterloo, Ontario, Canada
Posts: 13 mmarkin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 3 sec
Reputation Power: 0
Send a message via ICQ to mmarkin
Protected Folders: Pass variables?

Hi.

I have a client area with protected folders. Is it possible to have an HTML form that somehow passes in the submitted username and password to the protected directory? I want to do this in order to avoid the browser-dependent-and-ugly login prompt.

(I chose the protected folder method of making the client area over the PHP-mySQL-cookie way.)

Thanks

Mikhail

Reply With Quote
  #2  
Old January 12th, 2003, 03:10 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 42 m 50 sec
Reputation Power: 185
yes, the syntax is:

http://username:password@www.yourdomain.com/

and should work with the htaccess mechanism.

for a php login, if you accept GET variables you can use:
http://www.yourdomain.com/protected/login.php?username=user&password=secret
if the form fields are:
<input type="text" name="username">
<input type="password" name="password">
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #3  
Old January 12th, 2003, 05:58 PM
pinocchi pinocchi is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 19 pinocchi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

Try useing coockies as with get strings you would end up with urls including the login and password and I wonder whether that would be something you were looking for. Somebody else could easily hijack your login and password by just standing behind you for instance.

Just my .2 cents.

Erik

Reply With Quote
  #4  
Old January 13th, 2003, 02:48 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 42 m 50 sec
Reputation Power: 185
for the username: password part, in newer browsers iirc the password is not displayed on the screen anymore.
but it will probably still be logged in proxys and maybe in the apache logs.

pinocchi, password hijacking for "post" requests is not much harder...

only solution: use SSL!

Reply With Quote
  #5  
Old January 19th, 2003, 01:52 PM
mmarkin's Avatar
mmarkin mmarkin is offline
Russian Brains
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Location: Waterloo, Ontario, Canada
Posts: 13 mmarkin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 3 sec
Reputation Power: 0
Send a message via ICQ to mmarkin
Quote:
Originally posted by M.Hirsch
yes, the syntax is:

http://username:password@[url]www.yourdomain.com/

and should work with the htaccess mechanism.

for a php login, if you accept GET variables you can use:
http://www.yourdomain.com/protected/login.php?username=user&password=secret
if the form fields are:
<input type="text" name="username">
<input type="password" name="password">


One little problem:

When I type the user:password@... thing into my browser, it all works fine, but when I use

header("Location: http://$user:$pass@clients.mikhailmarkin.com/$user");

it doesnt work, and the browser just gives me the login prompt box. For debugging purposes (and to test if I was submitting my credentials properly), I changed header to echo in my PHP file. It outputed the whole location:... thing, and when I copied the url part into the browser window, it worked fine...

Any ideas?

Last edited by mmarkin : January 19th, 2003 at 01:55 PM.

Reply With Quote
  #6  
Old January 19th, 2003, 02:26 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 42 m 50 sec
Reputation Power: 185
ideas?
once again i think about quitting web business

this is "just another browser bug"... switch to another and see if it works then...
- it has to work with any browser
- it will probably work with few
- probably you are forced to use a form-based authentication instead.

workaround:
output this:
Code:
<html><head>
<meta http-equiv="refresh" content="1;url=http://user: password@www.domain.com">
</head><body></body></html>

- it should work with most browsers
- if a javascript-disabled browser does not follow meta-refresh´s, i call it "broken". (all IEs up to V5.5 are, in IE6 this is finally independent.)
- for these, i supply a link "if your browser does not forward you..." - now you know why the many other pages on the web do it...

... sometimes i really hate my job ...

edit:
afaik authentication is done using headers. maybe you can modify the request headers to pre-authenticate a user. not sure if this is possible in php though.

Last edited by M.Hirsch : January 19th, 2003 at 02:30 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Protected Folders: Pass variables?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT