![]() |
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 |
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!! |
is it possible to make the usernames be in a drop down box instead of typing them in, if so how???
|
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! |
im not going to have 2143446 members only about 6 lol
|
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 |
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 ;) |
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 [:: |
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). |
Nice thing dude :thumbsup:
little question: is it possible to mark the password field with ***** when you type your password? |
yes, you only need to use this attribute in the password input:
<INPUT type="password" ...> |
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: |
Quote:
|
err.....how would i make it so you can only view the website if you have entered the user name and password?
|
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.