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