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:11]
tjotov
— (current)
Line 1: Line 1:
-====== Web Integration API - Example ====== 
  
-<code html> 
-       <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.1534864304.txt.gz · Last modified: 2018/08/21 15:11 by tjotov