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
integration-api:example [2019/08/01 09:59]
tjotov removed
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; +        aucid.setRedirectUrl("/myapp/authenticated"); 
-             +        aducid.setErrorPage("/myapp/errorPage"); 
-         +         
-  +        aducid.processResult = function(result) { 
-         //handle PEIG not installed error +            if (result.status == "OK") { 
-         aducid.showPeigError = function() { +                alert("Success - status: " + result.status); 
-             alert("peig not found or other error"); +                location.href = result.redirect; 
-         +            
-  +            else { 
-         //handle communication or other error +                alert("Error - status: " + result.status); 
-         aducid.handleError = function(e) { +                location.href = result.redirect; 
-             alert(e.data.message); +            
-         +        
-  + 
-         aducid.showQRHint = function(param) { +        //handle PEIG not installed error 
-             $('#qr-code-hint').html("scan QR or click button to authenticate"); +        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) { 
-  +            alert(e.data.message); 
-         //GUI mapping +        
-         aducid.setButton($("#main-button")); + 
-         aducid.setQrCode($("#qr-code")); +        aducid.showQRHint = function(param) { 
-         aducid.setQrHint($("#qr-code-hint")); +            $('#qr-code-hint').html("Scan QR or click button to authenticate"); 
-  +        
-         //start + 
-         aducid.init(); +        aducid.showRunningHint = function(param) { 
-     }); +            $('#qr-code-hint').html("Operation is runni­ng"); 
- </script> +        }; 
- </head> + 
- <body> +        //GUI mapping 
-  +        aducid.setButton($("#main-button")); 
- <h1>LOGIN PAGE</h1> +        aducid.setQrCode($("#qr-code")); 
- <div> +        aducid.setQrHint($("#qr-code-hint")); 
- <button id="main-button">LOGIN using local PEIG</button> + 
- </div> +        //start 
- <img id="qr-code" alt="" /> +        aducid.init(); 
- <div id="qr-code-hint"></div> +    }); 
-  +</script> 
- </body> +</head> 
- </html>+<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> </code>