summaryrefslogtreecommitdiff
path: root/tests/test-auth.html
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-auth.html')
-rw-r--r--tests/test-auth.html97
1 files changed, 97 insertions, 0 deletions
diff --git a/tests/test-auth.html b/tests/test-auth.html
new file mode 100644
index 0000000..e628bca
--- /dev/null
+++ b/tests/test-auth.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<!--
+
+ Copyright (c) 2009 Samuel Lidén Borell <samuel@slbdata.se>
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+-->
+<title>BankID test</title>
+<script type="text/javascript">
+
+var output;
+var pluginVersion;
+
+function init() {
+ output = document.getElementById('output');
+ pluginVersion = document.getElementById('pluginVersion');
+ output.value = "";
+ output.value += "Version: \"";
+ output.value += pluginVersion.GetVersion()+"\"\n\n";
+
+ pluginAuth = document.getElementById('pluginAuth');
+ output.value += "Calling SetParam(Challenge)\n";
+ pluginAuth.SetParam("Challenge", "MTI0MzYwMTMyOTk5NTU3MTI4OTg0MjkwMzY3OTYwODM=");
+ output.value += "Calling SetParam(Policys)\n";
+ var retval = pluginAuth.SetParam("Policys", "MS4yLjc1Mi43OC4xLjE7MS4yLjc1Mi43OC4xLjI7MS4yLjMuNC41OzEuMi4zLjQuMTA=");
+
+ output.value += "retval of sp = "+retval+"\n";
+ output.value += "\nGetParam:\n";
+ output.value += " Challenge: \""+pluginAuth.GetParam("Challenge")+"\"\n";
+ output.value += " Policys: \""+pluginAuth.GetParam("Policys")+"\"\n";
+ output.value += " Signature: \""+pluginAuth.GetParam("Signature")+"\"\n";
+
+ output.value += "\nInvoking PerformAction(Authenticate):\n";
+ output.value += " return value = "+pluginAuth.PerformAction("Authenticate")+"\n";
+ output.value += " GetLastError() = "+pluginAuth.GetLastError()+"\n";
+
+ output.value += "\nGetParam:\n";
+ output.value += " Signature: \""+pluginAuth.GetParam("Signature")+"\"\n";
+}
+
+</script>
+</head>
+<body onload="init()" style="background: #FFFFDD">
+
+<p>You can use this file to verify that FriBID works. To do so,
+put this file on an SSL-enabled server and open it in a web browser
+(you can use a self-signed SSL-certificate if you don't want to
+buy one).</p>
+
+<p> Plugin installerad:
+<script type="text/javascript">
+var pluginInstalled = false;
+
+var pluginInstalled =
+ (navigator.mimeTypes &&
+ navigator.mimeTypes["application/x-personal-version"] &&
+ navigator.mimeTypes["application/x-personal-version"].enabledPlugin);
+
+document.write(pluginInstalled ? "Ja" : "Nej");
+</script>
+</p>
+
+<div>
+<textarea cols="80" rows="30" id="output">
+</textarea>
+</div>
+
+<div>
+<object id="pluginVersion" type="application/x-personal-version"></object>
+<object id="pluginAuth" type="application/x-personal-authentication"></object>
+</div>
+
+</body>
+</html>
+
+
+