Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlik sense SSO logout API

Hi

We have integrated Qlik Sense Hub into our application via Virtual Proxy with SAML based authentication.

I am able to log on to hub and able to view apps and do actions as per security rule perfectly good. Now when I logout on my application,I would like to logout the session from Qlik sense as well.

Is there any api that I can make use of to logout.

We also support multiple session for a single login. i.e., Same user can login from different location

How do I get to logout the user from Qlik in such cases?

Thanks

16 Replies
adnan_rafiq
Partner - Creator II
Partner - Creator II

Hi Mahendra,

Sorry to put an unwanted comment, but I have some issue where i feel you can help me.

I have been trying to apply SAML integration for while but was unable to do so other than onelogin.

did you performed SAML integration on standard application like sales force etc or customized application?

Thanks  alot in advance.

Not applicable
Author

Hi Adnan,

I have performed SAML integration with our In-house application.

Let me know what can I help you with?

Thanks

Anonymous
Not applicable
Author

I am in the same boat. Though I am thinking of using Qlik sense Proxy API.

https://help.qlik.com/en-US/sense-developer/2.0/Subsystems/ProxyServiceAPI/Content/ProxyServiceAPI/P...

adnan_rafiq
Partner - Creator II
Partner - Creator II

Thanks  a lot Mahendra for showing support.

Can I send you log from system on email. if you can send me a personal message with email id that will be great.

Not applicable
Author

Hi,

You should use the Qlik Sense Proxy API, but be sure to use the same session.

https://help.qlik.com/en-US/sense-developer/2.0/Subsystems/ProxyServiceAPI/Content/ProxyServiceAPI/P...

Here some C# code that might help.

   var serverPath = this.ServerUri + "/qps";

   if (!string.IsNullOrEmpty(this.VirtualProxyPath))

  serverPath += this.VirtualProxyPath;

   var request = (HttpWebRequest)HttpWebRequest.Create(serverPath + "/user");

  request.CookieContainer = new CookieContainer();

 

   foreach (var cookie in allCookies)

 

  request.CookieContainer.Add(new Uri(serverPath), cookie);

 

  request.Method = "DELETE";

Best Regards

Lars-Göran Book

konrad_mattheis
Luminary Alumni
Luminary Alumni

Hi Lars,

thanks for you code snippet, but this is only correct if you really use a virtual proxy. The Qlik Sever don't want for example 2 slahes in the URI. You have to set the / in the check of the VirtualproxyPath

Here is my Extensionmethod for the location class:

    public static class LocationExtensions_akquinet

    {

        private static Logger logger = LogManager.GetCurrentClassLogger();

        public static bool LogoutUser(this ILocation location)

        {

            try

            {

                var serverPath = location.ServerUri + "qps";

                if (!string.IsNullOrEmpty(location.VirtualProxyPath))

                    serverPath += "/"+location.VirtualProxyPath;

                var request = (HttpWebRequest)HttpWebRequest.Create(serverPath + "/user");

                request.CookieContainer = new CookieContainer();

                foreach (var cookie in location.CustomUserCookies)

                    request.CookieContainer.Add(new Uri(serverPath), new Cookie(cookie.Key, cookie.Value));

                var sc = location.SessionCookie().Split(new char[] { '=' });

                request.CookieContainer.Add(new Uri(serverPath), new Cookie(sc[0], sc[1]));

                request.Method = "DELETE";

                request.GetResponse();

                return true;

            }

            catch (Exception ex)

            {

                logger.Info(ex);

                return false;

   catch (Ex

            }

        }

    }

bye

Konrad

Anonymous
Not applicable
Author

Thanks for the snippet Konrad. I assume this code has to be executed from a server where qlik client certificate is already installed.

Lets assume we have a web socket connection , already authenticated. Can we direct call qps api from javascript for terminating the user session.

Thanks

-Vishal

jp_golay
Partner - Creator II
Partner - Creator II

Hi Lars

Konrad advice me to contact you  about a question:

I want to pass a X.509 client certificate to the .NET api in order to avoid having to register the root certificate in certmgr.

My idea is to store the certificates in the Version Manager repos database and distribute them through the http web requests. In Rest it is possible (restClient.ClientCertificates.Add(mQsHub.QsX509certificate);) but in .NET is there a hack in the api to allow this?
Thanks

ebiexperts CTO
With WIP, Control everything!
Qlik Sense, QlikView and NPrinting Source control, Versioning and Deployment, Agile Lifecycle Management
Not applicable
Author

Hi,
In the current version there is no way to supply the certificate to the SDK. A possible solution is to write an extension method that take the certificate as an parameter an stores it as a root certificate. See Working with Certificates

Best regards
Lars-Göran Book