-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIdPProxy_test.html
46 lines (41 loc) · 1.44 KB
/
IdPProxy_test.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>IdP Proxy NODE/OPENID CONNECT Test page</title>
</head>
<body>
<!--<script src="http://192.168.99.100:8080/.well-known/idp-proxy/rethink-oidc"></script>-->
<script id="proxy" type="text/javascript"></script>
<script>
function test(url, method, sid) {
var src = url+"/.well-known/idp-proxy/"+method+(sid? "/"+sid : "")
console.log(src)
document.getElementById('proxy').src= src
return false;
}
function login(content) {
idp.generateAssertion(content, '', 'acr=-1')
.then(response => {
console.log("received id_token :", response)
idp.validateAssertion(response.assertion)
.then(identity => console.log("User authenticated is "+identity.identity))
})
.catch(error => console.error("error: ", error))
//So that we don't reload the page
return false
}
//validateAssertion(id_token)
</script>
<form onsubmit="return test(this.url.value, this.method.value);">
<input type="text" id="url" name="url" placeholder="IdP URL"/>
<input type="text" id="method" name="method" placeholder="IdP Proxy Method"/>
<!-- <input type="text" id="sid" name="sid" placeholder="Optional SID"/>-->
<input type="submit" value="Load"/>
</form>
<form onsubmit="return login(this.content.value);">
<input type="text" id="content" name="content" value="testSDPFingerprint"/>
<input type="submit" value="Login"/>
</form>
</body>
</html>