-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
90 lines (73 loc) · 3.19 KB
/
index.html
File metadata and controls
90 lines (73 loc) · 3.19 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Authenteq Sample in-browser Implementation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<style>
input {
width: 200px;
}
label {
display: inline-block;
width: 150px;
}
</style>
</head>
<body>
<!--[if lte IE 9]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
<![endif]-->
<!-- Include SockJS -->
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1.1.5/dist/sockjs.min.js"></script>
<!-- Include StompJS -->
<script src="https://cdn.jsdelivr.net/npm/@stomp/stompjs@4.0.6/lib/stomp.min.js"></script>
<!-- Include Authenteq's browser build -->
<script src="../dist/client-lib.umd.js"></script>
<script type="text/javascript">
// Like jQuery $(document).ready()
document.addEventListener("DOMContentLoaded", function(event) {
var partnerId = '<<< INSERT YOUR PARTNER ID >>>';
var scope = 'givenname,surname,dob,nationality,passportno,aml,kyc,address';
if (partnerId === '<<< INSERT YOUR PARTNER ID >>>') {
console.log('Please, update your partnerId in the Javascript code in this file first!');
return;
}
// Connect to Authenteq API
Authenteq.connect(partnerId, scope, handleOnConnect, handleOnUserAuthenticate);
});
// Display AQR code sent in data.svg. "AQR code" stands for Authenteq QR code.
function handleOnConnect(data) {
var tokenId = data.tokenId;
var svg = data.svg;
console.log('handleOnConnect::tokenId', tokenId);
var imgNode = document.getElementById('aqr-code');
imgNode.src = Authenteq.createAQRSvg(svg);
}
// Use userToken to request Authenteq API
function handleOnUserAuthenticate(userToken) {
console.log('handleOnUserAuthenticate', userToken);
console.log('\
Now you can proceed and start with authentication claims \
Be careful to send this requests from your backend \
as you need to include your API key. If you would implement \
it here on client-side, your API key would be exposed. \
');
document.getElementById('usertoken').value = userToken;
}
</script>
<h1>Authenteq Sample in-browser Implmentation</h1>
<img id="aqr-code" width="330" height="330" alt="AQR code" />
<form action="verify-identity.php" method="POST">
<label>Given name</label> <input type="text" name="givenname" placeholder="John Martin" /> <br/>
<label>Last name</label> <input type="text" name="lastname" placeholder="McDonald" /> <br/>
<label>Nationality</label> <input type="text" name="nationality" placeholder="German, Germany, GER" /> <br/>
<label>Passport no</label> <input type="text" name="passportno" placeholder="01124456" /> <br/>
<label>User token</label> <input type="text" name="usertoken" id="usertoken" disabled="disabled" /> <br/>
<br/>
<input type="submit" value="Verify identity" />
</form>
</body>
</html>