Skip to content

Instantly share code, notes, and snippets.

View kabir-rab's full-sized avatar

Kabir Rab kabir-rab

View GitHub Profile
kabir-rab / OAuth-2.0-token-refresh-sub-routine.qvs
Last active January 26, 2021 17:16
A sample Qlik Sense load script to show how to regenerate OAuth 2.0 access token when they expire
// This a sample script to show how to regenerate OAuth 2.0 access token when they expire.
// More about OAuth 2.0 -
//Token exipiry time - setting this in the past, so that during the first run, it renews before code execution
LET vTokenEcpireTime = TIMESTAMP(NOW()-1000) ;
//Call this sub routine before all your other calls to make sure you have a valid token to complete the action
SUB RenewToken(vParamPlaceholder) //Just a placeholder variable for any future expansion of the routine
kabir-rab / qs-user-selection-log.qvs
Last active February 23, 2022 18:11
Qlik Sense user selections log importer script
///$tab Load variables
This section includes some variables used in the laod script.
Please amend this variables to point the app to the correct connections for your
environment, pointing to the log files.
SET liveLogConnection = '[YOUR_CONNECTION_NAME]';
SET serverName = '[YOUR_SERVER_NAME]';
SET liveLogLocation = '$(liveLogConnection)/$(serverName)_Audit_Engine.txt';
kabir-rab /
Last active October 24, 2022 15:04
Hierarchical relationships in Security Rules for Qlik Sense

Concept - Security rule in Qlik Sense

This section explains the concept of security rules in Qlik Sense


Before you can use the Qlik Sense system, in most cases you want to know who the user is, we call this authentication.

The next step is that based on this userId you want to assign the user access rights, we call this authorization. Both developers and users communicate with Sense via the Proxy (see this as a webserver which performs the authentication step: who are you?).

Authorization using the security rules

After the authentication (who are you?) you need to think how you want to integrate the authorization (what can you do and see?). The keys you want to protect in Sense are called resources. Example resources are

kabir-rab / site_availabity.ps1
Created October 8, 2019 10:44
Checks the Qlik Sense site availability and reboots all services if proxy service is not accessible
$Today = Get-Date -UFormat "%Y%m%d %H%M"
$LogFile = "\\[LOG_DIRECTORY]\SiteCheck.txt"
# Drop all the restrictions on script execution
Set-ExecutionPolicy Unrestricted
# URL to check
$uri = "[SITE_URL]"