Documentation CreateUser account
[CGIscriptor.git] / Private / Login.html
blob9ed2456515232f7bef447f3058314225294541c6
1 <html>
2 <head>
3 <title>Login</title>
4 <META CONTENT="text/ssperl; CGI='$SERVERSALT $LOGINTICKET $RANDOMSALT $REMOTE_ADDR'">
5 <SCRIPT type="text/javascript" LANGUAGE="JavaScript">
6 <SCRIPT TYPE="text/ssperl" SRC="./JavaScript/CGIscriptorSession.js"></SCRIPT>
8 // Remove EVERYTHING from Login window
9 window.onload = function() {
10 if(window.location.search)window.location.search = "";
11 var warning = document.getElementById('WARNING');
12 if(sessionStorage == null) warning.innerHTML = "Storage not supported by the browser: Upgrade your browser or set dom.storage.enabled";
13 else {
14 warning.style.color = "Black";
15 warning.innerHTML = "";
17 clear_persistent_data ();
19 </SCRIPT>
21 <script type="text/javascript">
22 <SCRIPT TYPE="text/ssperl" SRC="./JavaScript/sha.js"></SCRIPT>
23 </script>
25 </head>
26 <body>
27 <h1 align=CENTER>Example of Login procedure</h1>
28 <h2 align=CENTER><div id="WARNING" style="color: Red">You need to have JavaScript and cookies enabled to use the login system</div></h2>
29 <p>
30 Simple and very unsafe example login page for CGIscriptor.pl. The password is first hashed with the
31 site specific salt (as it is used to store the password on-site). Then it is hashed with a random,
32 one-time salt. Effectively, creating a one-time password. Only the last value is send to the server.
33 The server has both salt values stored. It will ignore anything except the username, hashed password, and
34 loginticket.
35 </p>
36 <p>
37 The Session Ticket information is stored in <a href="http://www.xul.fr/en/html5/sessionstorage.php">
38 <em>sessionStorage</em></a> with key <em>CGIscriptorPRIVATE</em>. Older browsers might not implement
39 <a href="http://www.xul.fr/en/html5/sessionstorage.php"><em>sessionStorage</em></a>, or it might be
40 turned off in the <a href="http://kb.mozillazine.org/Dom.storage.enabled"><em>dom.storage.enabled</em></a>
41 parameter.
42 </p>
43 <form method="POST" action="" id="LoginForm"
44 onSubmit='var success=check_username_password();SetSessionCookie();HashPassword("<SCRIPT TYPE="text/ssperl">
45 $RANDOMSALT</SCRIPT>");hidePasswords();success'>
46 <div style="margin-left: 30%; margin-right: 30%; text-align: right">
47 <table>
48 <tr><td>Username:</td><td><input type="text" name="CGIUSERNAME" id="CGIUSERNAME" size="60" /></td></tr>
49 <tr><td>Password:</td><td><input type="PASSWORD" name="PASSWORD" id="PASSWORD" size="60" /></td></tr>
50 <tr><td></td><td style="text-align: left"><input type="submit" value="Login" />
51 <input type="button" id="revealpassword" value="Show Passwords" onClick="this.value=togglePasswords('Hide', 'Show', this.value);true" /></td></tr>
52 </table>
53 <input type="hidden" name="SERVERSALT" id="SERVERSALT" value="<SCRIPT TYPE="text/ssperl">$SERVERSALT</SCRIPT>" />
54 <input type="hidden" name="LOGINTICKET" value="<SCRIPT TYPE="text/ssperl">$LOGINTICKET</SCRIPT>" />
55 </div>
56 </form>
57 <p>
58 There are three default test accounts, all three have password <em>test</em>:
59 <ul>
60 <li>test: A SESSION ticket account</li>
61 <li>testip: An IPADDRESS ticket account</li>
62 <li>testchallenge: A CHALLENGE ticket account</li>
63 </ul>
64 </p>
66 <p>
67 The Salt and Ticket values are all created using SHA256 on 64 Byte of output from <em>/dev/urandom</em> in HEX.
68 </p>
69 <FONT STYLE="font-size:small">
70 <p> Example Login page for CGIscriptor.pl<br />
71 Copyright &copy; 2012 R.J.J.H. van Son<br />
72 This program is free software: you can redistribute it and/or modify
73 it under the terms of the GNU General Public License as published by
74 the Free Software Foundation, either version 3 of the License, or
75 (at your option) any later version.
76 This program is distributed in the hope that it will be useful,
77 but WITHOUT ANY WARRANTY; without even the implied warranty of
78 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
79 GNU General Public License for more details.<br />
80 You should have received a copy of the GNU General Public License
81 along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.
82 </p>
83 <p> A JavaScript implementation of the SHA family of hashes, as defined in FIPS
84 PUB 180-2 as well as the corresponding HMAC implementation as defined in
85 FIPS PUB 198a<br />
86 Version 1.3 Copyright Brian Turek 2008-2010
87 Distributed under the BSD License<br />
88 See <a href="http://jssha.sourceforge.net/">http://jssha.sourceforge.net/</a> for more information<br />
89 Several functions taken from Paul Johnson
90 </p>
91 </FONT>
93 </body>
94 </html>