User Tools

Site Tools


integration-api:example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
integration-api:example [2018/08/21 15:12]
tjotov
— (current)
Line 1: Line 1:
-====== Web Integration API - Example ====== 
  
-<code html> 
- 
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en"> 
- 
-<head> 
-<script type="text/javascript" src="/aducid-resources/js/jquery.min.js"></script> 
-<script type="text/javascript" src="/aducid-resources/js/aducid-api.js"></script> 
- 
-<script type="text/javascript"> 
-    var aducid = new ADUCID(); 
-    $(document).ready(function() { 
-        aducid.setAuthentication(); 
-        aducid.setStartOperationUrl("/aducid-binder/open"); 
-        aducid.setResultOperationUrl("/aducid-binder/openCheck"); 
-        aducid.setProxyUrl("/aducid-binder/proxy"); 
-        aducid.setRedirectUrl("/aducid-binder/"); 
-        aducid.processResult = function(result) { 
-            if (result.status == "OK" || result.status == "ALF") { 
-                alert("Success - status: " + result.status); 
-                location.href = result.redirect; 
-            } 
-            else { 
-                alert("Error - status: " + result.status); 
-                location.href = result.redirect; 
-            } 
-        } 
- 
-        //handle PEIG not installed error 
-        aducid.showPeigError = function() { 
-            alert("peig not found or other error"); 
-        } 
- 
-        //handle communication or other error 
-        aducid.handleError = function(e) { 
-            alert(e.data.message); 
-        } 
- 
-        aducid.showQRHint = function(param) { 
-            $('#qr-code-hint').html("scan QR or click button to authenticate"); 
-        } 
- 
-        aducid.showRunningHint = function(param) { 
-            $('#qr-code-hint').html("operation is runníng"); 
-        }; 
- 
-        //GUI mapping 
-        aducid.setButton($("#main-button")); 
-        aducid.setQrCode($("#qr-code")); 
-        aducid.setQrHint($("#qr-code-hint")); 
- 
-        //start 
-        aducid.init(); 
-    }); 
-</script> 
-</head> 
-<body> 
- 
- <h1>LOGIN PAGE</h1> 
- <div> 
- <button id="main-button">LOGIN using local PEIG</button> 
- </div> 
- <img id="qr-code" alt="" /> 
- <div id="qr-code-hint"></div> 
- 
-</body> 
-</html> 
- 
- 
-</code> 
integration-api/example.1534864351.txt.gz · Last modified: 2018/08/21 15:12 by tjotov