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 October 13th, 2000, 05:35 PM
amead amead is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 5 amead User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have a small site where each page is generated on the fly by CGI. I used basic_auth to protect all the pages. Now customers want to access the site like this:

https://www.mysite.com?username=alan&password=mead

Note that https://alan:mead@www.mysite.com does *not* work (I can elaborate).

I am using Linux and Apache.

Q1: Is there any way to write server-side code that will allow users to access the site in this manner? All the CGI's that I know wouldn't prevent Apache from doing the 401 dialog with the user's browser.

Q2: Assume I need to switch to a "CGI-based" authentication scheme and I have a lot of existing users whose password only exists (hashed) in a htpasswd file. Does anyone know a way to either (a) decrypt/crack the existing passwords or (b) mimic the Apache authentication hash-matching?

-Alan


Reply With Quote
  #2  
Old October 20th, 2000, 04:27 AM
carlos carlos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 11 carlos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
A1: I would advise against doing this, since it appears that it can potentially open a security hole and cause more of a headache trying to code. Basically, when Apache authenticates, it sets the environment variable REMOTE_USER to the username, so that is checks this value for subsequent requests. Therefore in elminating Apache authentication method, your cgi-script will have to somehow maintain state so that it knows that the user has already been authenticated. And since cgi-scripts are stateless, you will have to comeup with a way accomplish this. However, if you really want your own customized authentication, write an Apache Authenication handler. This is probably the best route. If you knwo Perl you should have no problem writing one.

A2: You can use the HTTPD::UserAdmin perl module to check against existing passwords.
It provides a function that accepts a plain text password and then encrypts it and matches it against the existing encrypted password in the htpasswd file.

Hope this helps.


<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by amead:
I have a small site where each page is generated on the fly by CGI. I used basic_auth to protect all the pages. Now customers want to access the site like this:

https://www.mysite.com?username=alan&password=mead

Note that https://alan:mead@www.mysite.com does *not* work (I can elaborate).

I am using Linux and Apache.

Q1: Is there any way to write server-side code that will allow users to access the site in this manner? All the CGI's that I know wouldn't prevent Apache from doing the 401 dialog with the user's browser.

Q2: Assume I need to switch to a "CGI-based" authentication scheme and I have a lot of existing users whose password only exists (hashed) in a htpasswd file. Does anyone know a way to either (a) decrypt/crack the existing passwords or (b) mimic the Apache authentication hash-matching?

-Alan
[/quote]


Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > mixing basic_auth and CGI authentication


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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway