Page 1 of 1

Password protect a directory with password only?

Posted: Fri Aug 14, 2009 12:17 am
by xtk
for example, .htaccess uses a username:password prompt

i would like a method of input (over a https connection) that asks for a password only, or in other words no username

possible? with .htaccess or another .example format?

or could i somehow use php to achieve this, or another programming language if there is not a .example type of way???

regards

Re: Password protect a directory with password only?

Posted: Fri Aug 14, 2009 11:57 pm
by swhistlesoft
Basic Auth or Digest Auth is server side authentication (as you probably already know). You cannot configure it to only prompt for a password.

The solution you would need would have to be custom scripting. You can do this with PHP rather simply.

Simply solution is to store the passwords in a database or file as MD5 hash values. Then when a user enters in a password, you can do a compare on the values stored in the database. If one matches, you set a session variable indicating the user is logged in. If not you redirect them to an error page, or whatever you want.

There are a ton of ways to handle log ins with PHP. It all depends on the type of security you want.

Re: Password protect a directory with password only?

Posted: Sat Aug 15, 2009 2:37 am
by kaisellgren
Why would you want to have a password-only log-in?
swhistlesoft wrote:Simply solution is to store the passwords in a database or file as MD5 hash values.
Someone is actually still suggesting to use MD5? Just use SHA-2 or Whirlpool. It won't be complicating and gives you a greater level of security.

Re: Password protect a directory with password only?

Posted: Wed Aug 19, 2009 9:48 am
by Mordred
You can do it with a simple piece of .js redirection:
http://www.example.com/content/ shows a js prompt for "password", and then redirects onwards to http://www.example.com/content/password
Changing the password is as simple as renaming the folder.

Re: Password protect a directory with password only?

Posted: Sun Aug 23, 2009 2:59 pm
by tictac3
Great. Thanks for sharing.
comparatif simulation credit taux comparer auto - Taux crédit auto. Comparatif des offres! Les meilleurs taux crédit auto sont sur le net !comparatif simulation credit taux comparer auto