Calling LogOnWithWindowsAuthentication2 using JSON
Article # 3035204 - Page views: 81
Issue
This article describes how to call LogOnWithWindowsAuthentication2 using JSON
Solution
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>
Level of Complexity
High
Applies to
Product | Version | Build | Environment | Hardware |
---|---|---|---|---|
Kofax TotalAgility | v7.x |
References
Article # 3035204