User Tools

Site Tools


integration-api:example

Differences

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

Link to this comparison view

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