I'm responsible for the coding of a community website for a group in the North of the UK. As part of this, we need to include some "member-only" features, such as planning of events, profiles and more extensive contact information than we want to make publically accessible.
I've developed a script in CGI that will take, and validate, a username and password, storing both pieces of information in instance variables within the script (the password obviously crypted). The script can then output the site's menu dependant on whether the user is logged in or not. I should point out that the user validation and menu output is handled by the same script - the login state is not passed out to a secondary script. The menu itself is in a frame so that it doesn't get refreshed, and hence the username/password variables reset each time a content page is loaded.
When member-only content is accessed, a second script, serveContent, is called, into which is passed the username, a crypted version of the password, and the page which the user is attempting to access, which again checks user authorisation and either displays the requested page or demands the user log in.
I don't want to drop cookies to control the login for various reasons - not least because they've caused problems in the past within the group and there's a lot of opposition to them. This is fine, I don't need data persistance - when the entire page is refreshed, the instance variables containing the username and password within the login script are reset and the user is logged out.
I've set a quick version of the page running with this code and it seems to work well - logins/logouts are handled efficiently and the load-time is nice and fast, even for accessing member-only pages.
I can't help but think that this double-authentication method could cause some loadtime issues in the future, as the site and its memberbase expands. This isn't an issue at present, although it's something I'm looking into.
What I'm interested to know is whether anyone knows of any security problems that could be caused by doing things this way rather than a more "conventional" method of handling user authentication? Has anyone done something this way in the past and hit problems?
Looking to the future, do people think that this method is likely to cause problems with access times, and can anyone suggest a better way of implementing this? I'm thinking about unique session IDs, that can be generated and validated in-code, without a call to the database being required.
I should point out that I'm not after something militarily secure - but I wouldn't like phone numbers of members and stuff like that passing out into the public domain.
I'm very interested to know any thoughts/comments/criticisms people have about this way of doing things .. and any suggestions would be appreciated.
Cheers ..
-- Foxcub
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Security in CGI and User Authentication
by mirod (Canon) on Dec 03, 2002 at 13:11 UTC | |
by Tanalis (Curate) on Dec 03, 2002 at 13:19 UTC | |
by shotgunefx (Parson) on Dec 04, 2002 at 02:51 UTC | |
by Aristotle (Chancellor) on Dec 04, 2002 at 09:17 UTC | |
by BUU (Prior) on Dec 04, 2002 at 03:21 UTC | |
|
Re: Security in CGI and User Authentication
by abell (Chaplain) on Dec 03, 2002 at 16:16 UTC | |
by Anonymous Monk on Dec 04, 2002 at 01:27 UTC | |
|
Re: Security in CGI and User Authentication
by Chady (Priest) on Dec 04, 2002 at 08:01 UTC |