User Tools

Site Tools


integration-api:example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
integration-api:example [2018/08/21 15:07]
tjotov created
integration-api:example [2018/08/21 15:09]
tjotov
Line 2: Line 2:
  
  
-<!DOCTYPE html+       <script type="text/javascript"
-<html xmlns="http://www.w3.org/1999/xhtmllang="en"> +     var aducid new ADUCID(); 
-<head> +     $(document).ready(function() { 
-<script type="text/javascriptsrc="/aducid-resources/js/jquery.min.js"></script> +         aducid.setAuthentication(); 
-<script type="text/javascriptsrc="/aducid-resources/js/aducid-api.js"></script>+         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>
  
- 
-<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>