-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
56 lines (34 loc) · 1.06 KB
/
example.html
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
<!DOCTYPE html>
<html>
<body>
<script type='module'>
import webgss from './lib/webgss.js';
async function getAuthResource(user, pwd)
{
webgss.setKrb5Trace();
let client = await webgss.gssClient('../KdcProxy', user, pwd);
let reply = await client.fetch('../hello');
let text = await reply.text();
return text;
}
function auth() {
let form = document.getElementById('login-form');
let user = form.uname.value;
let pwd = form.pwd.value;
form.reset();
getAuthResource(user, pwd).then(text => {
document.body.textContent = text;
});
}
let button = document.getElementById('button');
button.addEventListener('click', auth);
</script>
<form id="login-form" autocomplete="off">
<label for="uname"><b>Username</b></label> <br>
<input type="text" placeholder="Enter Username" name="uname" required> <br>
<label for="pwd"><b>Password</b></label> <br>
<input type="password" placeholder="Enter Password" name="pwd" required> <br>
<input type="button" id="button" value="Login">
</form>
</body>
</html>