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