-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.html
65 lines (56 loc) · 2.47 KB
/
index.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
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html lang="en-US" class="h-100">
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="minerva-browser" style="position: absolute; top: 0; left: 0; height: 100%; width: 100%;"> </div>
<script defer src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
<script src="https://api.html5media.info/1.2.2/html5media.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/amazon-cognito-identity.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/bundle.dev.js"></script>
<script>
const speech_bucket = "";
const authenticate = function(username, pass) {
const authenticateUser = function(cognitoUser, authenticationDetails) {
return new Promise(function(resolve, reject) {
cognitoUser.authenticateUser(authenticationDetails, {
onSuccess: result => resolve(result),
onFailure: err => reject(err),
mfaRequired: codeDeliveryDetails => reject(codeDeliveryDetails),
newPasswordRequired: (fields, required) => reject({fields, required})
});
});
};
return pass.then(function(password) {
const minervaPoolId = 'us-east-1_d3Wusx6qp';
const minervaClientId = 'cvuuuuogh6nmqm8491iiu1lh5';
const minervaPool = new AmazonCognitoIdentity.CognitoUserPool({
UserPoolId : minervaPoolId,
ClientId : minervaClientId
});
const cognitoUser = new AmazonCognitoIdentity.CognitoUser({
Username: username,
Pool: minervaPool
});
const authenticationDetails = new AmazonCognitoIdentity.AuthenticationDetails({
Username: username,
Password: password
});
return authenticateUser(cognitoUser, authenticationDetails)
.then(response => response.getIdToken().getJwtToken());
});
}
window.viewer = MinervaStory.default.build_page({
hideWelcome: true,
authenticate: authenticate,
speech_bucket: speech_bucket,
exhibit: "exhibit.json",
id: "minerva-browser",
embedded: true
});
</script>
</body>
</html>