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 Both sides next revision
integration-api:example [2018/08/21 15:11]
tjotov
integration-api:example [2018/08/21 15:12]
tjotov
Line 2: Line 2:
  
 <code html> <code html>
-       <script type="text/javascript"> + 
-     var aducid = new ADUCID(); +<html xmlns="http://www.w3.org/1999/xhtml" lang="en"> 
-     $(document).ready(function() { + 
-         aducid.setAuthentication(); +<head> 
-         aducid.setStartOperationUrl("/aducid-binder/open"); +<script type="text/javascript" src="/aducid-resources/js/jquery.min.js"></script> 
-         aducid.setResultOperationUrl("/aducid-binder/openCheck"); +<script type="text/javascript" src="/aducid-resources/js/aducid-api.js"></script> 
-         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> 
  
 </code> </code>