npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

qlik-auth

v1.2.3

Published

A module for simplyfing custom authentication with the Qlik Sense and QlikView products

Downloads

69

Readme

WHAT IS QLIK-AUTH?

qlik-auth is an attempt of simplyfing custom authentication with the Qlik Sense and QlikView products. This module for Node.js takes care of the ticket request and redirection. It allows a developer to focus on obtaining the user profile, provide it in a function call, and the rest will be automated.

REQUIREMENTS

INSTALLATION

npm install qlik-auth

EXAMPLE

This is just a minimal example to demonstrate how simple it is to use the module. The code below is from the Node.js website demonstrating how to run a webserver, with code added to handle a ticket request. This should only be seen as a demonstration and a way to get started. Normally you would for want to run the server as HTTPS and so on.

var http = require('http');
var qlikauth = require('qlik-auth');
http.createServer(function (req, res) {

  //Define user directory, user identity and attributes
  var profile = {
    'UserDirectory': 'QLIK', 
    'UserId': 'rikard',
    'Attributes': [{'Group': 'ExampleGroup'}]
  }

  //Make call for ticket request
  qlikauth.requestTicket(req, res, profile);

}).listen(1337, '0.0.0.0');
console.log('Server running at http://localhost:1337/');

SETUP FOR QLIK SENSE

Typically a custom authentication module in Qlik Sense would be called through a virtual proxy. Refer to Qlik Sense documentation how to set this up and configure it properly to access your custom built module.

  • In the example above a simple webserver is created with Node.js which listens on port 1337. This is the server and port you need to map in the virtual proxy configuration.

  • On Windows the module will attempt to use the QlikClient certificate in the Windows Certificate Store. If no certificate is not found it will then look for client.pfx and finally client.pem/client_key.pem in the current path.

  • Export the client certificates including the private key from QMC and copy it to the same directory as your script. If it's necessary to provide a password, see the Advanced section below.

ADVANCED USAGE

The module exposes a function called requestTicket which has the following parameters:

function(req, res, profile, options)

The profile parameter:

var profile = {
  'UserDirectory': 'QLIK', 
  'UserId': 'rikard',
  'Attributes': []
}

The options parameter:

  • In case the certificate is password protected it's possible to provide both the location and filename of the certificate together with a passphrase. It could look like this:

    var options = { 'Certificate': './client.pfx', 'PassPhrase': '' }

  • When Qlik Sense is redirecting to a custom authentication module it passes proxyRestUri and targetId as parameters. These are normally handled by the function automatically, but for scenarios where it might be necessary to redirect to another Identity Provider (IdP) for example, these parameters must be stored away and supplied manually.

    var options = { 'ProxyRestUri': session.proxyRestUri, 'TargetId': session.targetId }

Optionally (or actually preferred method) could be to use the builtin init(req, res) function on your index page. This will attempt to save the parameters which the requestTicket function will later automatically pick up.

SETUP FOR QLIKVIEW

QlikView would need to be configured for using webtickets, this includes changing Windows Authentication to Anonymous Authentication and configuring IP white lists as trust. Please refer to QlikView documentation how to do this.

ADVANCED USAGE

The function to use for QlikView is called requestWebTicket and has the following parameters:

function(req, res, profile, options)

Where profile and options looks like this:

 var profile = {
   'UserDirectory': 'QLIK', 
   'UserId': 'rikard',
   'Groups': []
 }
  • UserDirectory: A domain prefix in QlikView, but should in most cases match a user directory.

  • UserId: The user identity which will be authenticated in QlikView.

  • Groups: An array of group memberships to include in the ticket request.

    var options = { 'Host': 'http://localhost', 'TryUrl': '/QlikView', 'BackUrl': '', 'Document': 'Movies Database' }

  • Host: Hostname, default is localhost (include http/https if specified)

  • TryUrl: Where you want to end up after succesfull authentication, in most cases this would be AccessPoint which is the default value.

  • BackUrl: Could be an error page or login page if authentication failed.

  • Document: A QlikView document, if specified it will bypass AccessPoint and go directly to the document.