Pelican Parts
Parts Catalog Accessories Catalog How To Articles Tech Forums
Call Pelican Parts at 888-280-7799
Shopping Cart Cart | Project List | Order Status | Help



Go Back   Pelican Parts Forums > Miscellaneous and Off Topic Forums > Off Topic Discussions


Reply
 
LinkBack Thread Tools Rating: Thread Rating: 2 votes, 3.00 average.
Author
Thread Post New Thread    Reply
MBruns for President
 
JeremyD's Avatar
 
Join Date: Jun 2001
Location: St. Pete, FL
Posts: 15,061
Garage
Web developers - what's the easiest way to password protect a page?

I have been creating and maintaining our company website - just one of the hats I wear.

One of the pages I want to set up with profiles of candidates (with a short video) that I want our client (only) to access - is there a way to password protect this page? I know I can create it blind - and that someone would have to have the exact address to access - bt I'd prefer to password protect it.

I've been using Front page -= also have MS expression loaded - but not that easy to use. help or direction would be appreciated

__________________
Current Whip: - 2003 996 Twin Turbo - 39K miles - Lapis Blue/Grey
Past: 1974 IROC (3.6) , 1987 Cabriolet (3.4) , 1990 C2 Targa, 1989 S2
Old 07-22-2009, 11:20 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #1 (permalink)
Porsche 911 SC, SAAB SPG
 
Join Date: Sep 2007
Location: Charlotte, NC
Posts: 308
The easiest way to do this is to have an opening page that presents a password text box and a button. The user then puts in the password and hits the okay button.

You run a javascript to check the password and either load the protected page, or throw up an error message saying to try again.

You also need to prevent the protected page from loading if someone is smart enough to put in the URL directly. Another javascript could handle this on the protected page. You will probably need a flag of some kind on the client side to see if they typed in the password or not.

There are other ways to do this as others may comment. This is just what came to my head first.
__________________
Jeff C
Old 07-22-2009, 12:05 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #2 (permalink)
Registered
 
slodave's Avatar
 
Join Date: Sep 2005
Location: Encino Man
Posts: 22,394
Garage
Send a message via Skype™ to slodave
See if your host supports htaccess files.

http://www.sitedeveloper.ws/tutorials/htaccess.htm
__________________
Make sure to check out my balls in the Pelican Parts Catalog! 917 inspired shift knobs.

'84 Targa - Arena Red - AX #104
'07 Toyota Camry Hybrid - Yes, I'm that guy...
'01 Toyota Corolla - Urban Camouflage - SOLD
Old 07-22-2009, 01:46 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #3 (permalink)
Registered
 
Join Date: Jan 2003
Location: IL
Posts: 1,638
super simple version...

header on all 'secure pages to check if a cookie = 'logged in'
if not, redirect to login form
login form goes to page that check to see if the form entries = some hard coded values
if the equal, then set the cookie to 'logged in' and redirect to secured page
if not equal then redirect back to the login form.
Old 07-22-2009, 02:29 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #4 (permalink)
Registered
 
gwood's Avatar
 
Join Date: Feb 2007
Posts: 352
Expression Web will have a login control to put on your opening page and a preconfigured membership database. Search the help files for "membership."
Old 07-22-2009, 04:18 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #5 (permalink)
Registered
 
jeffgrant's Avatar
 
Join Date: Mar 2005
Location: London, ON, Canada
Posts: 1,737
Quote:
Originally Posted by jcunning View Post
The easiest way to do this is to have an opening page that presents a password text box and a button. The user then puts in the password and hits the okay button.

You run a javascript to check the password and either load the protected page, or throw up an error message saying to try again.

You also need to prevent the protected page from loading if someone is smart enough to put in the URL directly. Another javascript could handle this on the protected page. You will probably need a flag of some kind on the client side to see if they typed in the password or not.

There are other ways to do this as others may comment. This is just what came to my head first.


Never, EVER trust authentication or authorization on the client side. If you tried to protect a page as you just mentioned, I'd be into it in no time flat. By definition, you've allowed all the code to the client, and it can be read and reversed engineered, regardless of how obfuscated it is.

That's equivalent to locking your door but leaving the key under the mat.


Do the protection from the web server config files, where you can define the URLs/paths to protect, users, groups, and realms, utilizing simple/basic http password protection.

It's integrated in EVERY web browser, and automatically deals with the security tokens/cookies/etc. It can even handle browsers that don't have cookies enabled.

This can be done via an .htaccess file (as slodave says), assuming the "allowOverrides" option has been enabled.

It also depends on what web server you're running. (.htaccess is usually an Apache thing).


Figure out what web server you're running, and then Google for that server and "authentication", and you should be good to go.


$0.02


PS: I'm a technical architect specializing in internet security engineering, if that makes any difference.
Old 07-22-2009, 07:40 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #6 (permalink)
 
Registered
 
jeffgrant's Avatar
 
Join Date: Mar 2005
Location: London, ON, Canada
Posts: 1,737
I should also mention that the method I've described allows you to protect other non-web-page content as well, such as graphics, downloadable assets (pdf files, movies, etc).
Old 07-22-2009, 07:42 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #7 (permalink)
Stay away from my Member
 
campbellcj's Avatar
 
Join Date: Aug 1999
Location: Agoura, CA
Posts: 5,773
If you are using IIS (Windows) for the web server, you can simply turn off anonymous access for a site or folder. Then any user will need to input a regular Windows ID and password to login -- this means you have to have a way to set up accounts for your users as well as have enough licenses (CALS) for them. It really depends on your exact needs and environment as there are lots of options -- although some require coding or installation of additional code to implement.
__________________
Chris C.
1973 914 "R" (914-6) | track toy
2009 911 Turbo 6-speed (997.1TT) | street weapon
2021 Tesla Model 3 Performance | daily driver
2001 F150 Supercrew 4x4 | hauler
Old 07-22-2009, 08:35 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #8 (permalink)
MBruns for President
 
JeremyD's Avatar
 
Join Date: Jun 2001
Location: St. Pete, FL
Posts: 15,061
Garage
Thanks for the input - I'll check these out - this really helps give me some direction
__________________
Current Whip: - 2003 996 Twin Turbo - 39K miles - Lapis Blue/Grey
Past: 1974 IROC (3.6) , 1987 Cabriolet (3.4) , 1990 C2 Targa, 1989 S2
Old 07-23-2009, 05:08 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #9 (permalink)
Registered
 
Join Date: Jan 2003
Location: IL
Posts: 1,638
Quote:
Originally Posted by jeffgrant View Post
Never, EVER trust authentication or authorization on the client side. If you tried to protect a page as you just mentioned, I'd be into it in no time flat. By definition, you've allowed all the code to the client, and it can be read and reversed engineered, regardless of how obfuscated it is.
I was assuming (my fault) PHP or ASP server side script for that 'solution'.

He asked for something simple, that's a simple solution that requires a bit of coding.

If it allows htaccess files, go that direction. if its an iis machine (some IIS hosts also allow htaccess), here's some code to use the web.config method...

http://support.netfirms.com/idx.php/73/786/article/How-do-I-passwordprotect-a-web-page-using-ASPNET.html

Last edited by einreb; 07-23-2009 at 05:36 AM..
Old 07-23-2009, 05:26 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #10 (permalink)
Registered
 
jeffgrant's Avatar
 
Join Date: Mar 2005
Location: London, ON, Canada
Posts: 1,737
Quote:
Originally Posted by einreb View Post
I was assuming (my fault) PHP or ASP server side script for that 'solution'.

He asked for something simple, that's a simple solution that requires a bit of coding.

If it allows htaccess files, go that direction. if its an iis machine (some IIS hosts also allow htaccess), here's some code to use the web.config method...

http://support.netfirms.com/idx.php/73/786/article/How-do-I-passwordprotect-a-web-page-using-ASPNET.html
Ahh... my bad. I never really consider Javascript as a server-side solution, only client side.

Old 07-23-2009, 06:03 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #11 (permalink)
Reply


 


All times are GMT -8. The time now is 03:36 AM.


 
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0
Copyright 2025 Pelican Parts, LLC - Posts may be archived for display on the Pelican Parts Website -    DMCA Registered Agent Contact Page
 

DTO Garage Plus vBulletin Plugins by Drive Thru Online, Inc.