1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
<HTML>
<HEAD>
<SCRIPT>
var gaia = gaia || {};
gaia.chromeOSLogin = {};
gaia.chromeOSLogin.parent_page_url_ =
'chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/main.html';
gaia.chromeOSLogin.attemptLogin = function(email, password, attemptToken) {
var msg = {
'method': 'attemptLogin',
'email': email,
'password': password,
'attemptToken': attemptToken
};
window.parent.postMessage(msg, gaia.chromeOSLogin.parent_page_url_);
};
gaia.chromeOSLogin.clearOldAttempts = function() {
var msg = {
'method': 'clearOldAttempts'
};
window.parent.postMessage(msg, gaia.chromeOSLogin.parent_page_url_);
};
gaia.chromeOSLogin.onAttemptedLogin = function(emailFormElement,
passwordFormElement,
continueUrlElement) {
var email = emailFormElement.value;
var passwd = passwordFormElement.value;
var attemptToken = new Date().getTime();
gaia.chromeOSLogin.attemptLogin(email, passwd, attemptToken);
if (continueUrlElement) {
var prevAttemptIndex = continueUrlElement.value.indexOf('?attemptToken');
if (prevAttemptIndex != -1) {
continueUrlElement.value =
continueUrlElement.value.substr(0, prevAttemptIndex);
}
continueUrlElement.value += '?attemptToken=' + attemptToken;
}
};
function submitAndGo() {
gaia.chromeOSLogin.onAttemptedLogin(document.getElementById("Email"),
document.getElementById("Passwd"),
document.getElementById("continue"));
return true;
}
function onAuthError() {
if (window.domAutomationController) {
window.domAutomationController.sendWithId(4444, 'loginfail');
}
}
function onLoad() {
gaia.chromeOSLogin.clearOldAttempts();
}
</SCRIPT>
</HEAD>
<BODY onload='onLoad();'>
Local Auth Server:<BR>
<FORM action='/ServiceLoginAuth' method=POST onsubmit='submitAndGo()'>
<INPUT TYPE=text id="Email" name="Email">
<INPUT TYPE=text id="Passwd" name="Passwd">
<INPUT TYPE=hidden id="continue" name="continue"
value="chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/success.html">
<INPUT TYPE=Submit id="signIn">
</FORM>
</BODY>
</HTML>
|