Skip to main content
Kofax

Kofax TotalAgility 7.x - Calling LogOnWithWindowsAuthentication2 using JSON

This article describes how to call LogOnWithWindowsAuthentication2 using JSON

Applies To

Kofax TotalAgility 7.x

Resolution

Calling UserService
Method: LogOnWithPassword2()
  • Create a html file using the below code
  • Host the file in web server using the path where the HTML file resides e.g. C:\inetpub\wwwroot\
  • Browse the html file and it will invoke Calling LogOnWithWindowsAuthentication2 in UserService
  • Change logonJSON.unconditionalLogOn to true/false depending on requirements

<html>
<body>
    <header>
        <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    </header>
    <div id="Request"></div>
    <div id="Result"></div>
    <script>
        var LogOnWithWindowsAuthentication2struct = function () {
            var struct = {
                    "logOnProtocol": "",                    
                    "unconditionalLogOn": false,
            };
            return struct;
        };


        var logonJSON = new LogOnWithWindowsAuthentication2struct();
        logonJSON.logOnProtocol = "7";
        logonJSON.unconditionalLogOn =  true;


        $("#Request").html("<BR/><B>Request:</B><BR/>" + JSON.stringify(logonJSON));

        // Calling method LogOnWithWindowsAuthentication2
        $.ajax({
            type: "POST",
            async: "false",
            url: "http://localhost/TotalAgility/Servic...uthentication2",
            data: JSON.stringify(logonJSON),            
            contentType: "application/json; charset=utf-8",
            crossDomain: true,
            dataType: "json",
            success: function (result) {
                $("#Result").html("<BR/><B>Response: </B><BR/>" + JSON.stringify(result.d));
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert("***Error***\n" +  errorThrown + "\n" + textStatus);
            }
        });

    </script>
</body>
</html>

  • Was this article helpful?