Skip to main content

Connecting using Microsoft Windows authentication

The following example shows one way of connecting to the Qlik NPrinting Server using Microsoft Windows authentication in a .NET console application. Remember to substitute with your actual Qlik NPrinting Server name.

static void Main(string[] args) { //Create the HTTP Request (authenticate) and add required headers ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@ ""); request.Method = "GET"; request.UserAgent = "Windows"; request.Accept = "application/json"; // specify to run as the current Microsoft Windows user request.UseDefaultCredentials = true; try { // make the web request and return the content HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader responseReader = new StreamReader(response.GetResponseStream()); string sResponseHTML = responseReader.ReadToEnd(); Console.WriteLine(sResponseHTML); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.Read(); }

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!