CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Post a JavaScript (http://www.codingforums.com/forumdisplay.php?f=19)
-   -   Secure Login with javascript (http://www.codingforums.com/showthread.php?t=10114)

Borgtex 11-19-2002 07:51 PM

Secure Login with javascript
 
1 Attachment(s)
Here is my "total secure login" script. Description of the contents:

login.htm: First page. It asks login and password, combines it (Login+Password) and sends it to the next page

auth.htm: checks for the existence of a Login+Password.js if yes (authorized user), it reads the private url and opens it, if not, it goes back to the first page, wich shows an error message

CodingForums.js: a Login+Password.js sample. You can have as many users as you want; one .js for every one (i.e. Login: Neo, Pwd: Matrix =NeoMatrix.js). Blocking an user access is as easy as deleting his .js file

page.htm:a sample destination page

PasswordHelper.vbs: a nice script that creates the js files

Of course, server side programming is much better if you have sensitive data to protect

Edited: Due the popularity of this script, I updated the original version with the one with whammy improvements, like the Password Helper

Ricky158 11-24-2002 01:15 AM

holy $*@&

i've been looking for a good password-gate-like thing for a loooooong time. this is awesome! i was about ready to post that i was having trouble, before i found out what to do. here's how i got it to work...

1) unzipped the files
2) uploaded ALL of them to my site
3) created a new "CoddingForums.js" page and renamed "CoddingForums"
4) in renamed "CoddingForums" page, paste all info from the text in the "CoddingForums.js" into the new, renamed page
5) thank borgtex for the awesome script

also, you've got to make sure the file name is "{Name}{Password}.js" no {}'s, no spaces, first letter of name and password is capitalized (or so i think. but i'm afraid to test). it works fine for me, doing the method above.

THANKS BORGTEX!!

KaoS 11-24-2002 10:04 PM

is it possible to make the usernames be in a drop down box instead of typing them in, if so how???

Ricky158 11-25-2002 10:53 PM

hmmm... let's use My Yahoo! for example. does Yahoo! have a drop-down menu listing ALL of their members' usernames? wasnt like that the last time I checked... so i think it would just be more appropriate (in any case) for it to just be a type-in thing. because in my case, i use that script so it's harder for someone to access a certain page. giving them half of the entry information needed to access the page doesnt really help.

but you can do what you want with the script, but i have such little knowledge of javascript that i can't help you. but hey, i know the comment tag: // yay!

KaoS 11-25-2002 10:57 PM

im not going to have 2143446 members only about 6 lol

Borgtex 11-26-2002 02:26 AM

Just change the textbox for a dropdown menu, and access the value of the selectedIndex.
If you're not familiar with dropdowns & javascript, post your question in the JavaScript programming forum

SYP}{ER 12-25-2002 11:23 AM

If your data is that important, use .htaccess & .htpasswd to keep the unwanted out.

If someone wants to get in, and has intermediate to advanced knowledge of javascript, they can and will ;)

krycek 12-25-2002 11:47 AM

Just a warning: like SYP}{ER said, it is impossible to have a secure system using JavaScript alone.

A good system would be on the server side, or use .htaccess, or both.

But all the same, well done Borgtex for providing something that people want :)

Merry Christmas Everyone!

::] krycek [::

Alex Vincent 12-31-2002 12:00 AM

Hm, sounds interesting. You have to download the authentication file from the server, or you're going nowhere. In this case, knowing JavaScript may not help very much -- because the password helps define the name of the script to request by HTTP.

Creating a dropdown menu is a security risk: it gives a person who wants in but isn't authorized a much narrower field of possible filenames to search.

Plus, there's always the possibility that a different combination of characters will yield a valid result (taking a letter off the password and sticking it on the username, for instance).

CrUdE 01-22-2003 01:39 PM

Nice thing dude :thumbsup:

little question: is it possible to mark the password field with ***** when you type your password?

Borgtex 01-22-2003 03:00 PM

yes, you only need to use this attribute in the password input:

<INPUT type="password" ...>

CrUdE 01-22-2003 03:03 PM

OMG!!!!

Didn't thaught about that one.

anyway thankx m8 and keep up the good work.

another question.

Cos u r all leets in JS maybe I can ask u peeps to provide me with some good links to tutors etc. cos I'm not really into JS, and I'd like to be :rolleyes:

redhead 01-22-2003 04:31 PM

Quote:

Originally posted by CrUdE
maybe I can ask u peeps to provide me with some good links to tutors etc. cos I'm not really into JS, and I'd like to be :rolleyes:
www.javascriptkit.com has some good tutorials :)

relyt 01-23-2003 03:32 AM

err.....how would i make it so you can only view the website if you have entered the user name and password?

CrUdE 01-23-2003 08:53 AM

I think making your index.htm the page with the javascript in it


All times are GMT +1. The time now is 09:27 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.