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
Next revision Both sides next revision
integration-api:example [2018/08/21 15:09]
tjotov
integration-api:example [2018/08/21 15:12]
tjotov
Line 1: Line 1:
 ====== Web Integration API - Example ====== ====== Web Integration API - Example ======
  
 +<code html>
  
-       <script type="text/javascript"> +<html xmlns="http://www.w3.org/1999/xhtmllang="en">
-     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>+
  
 +<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>