Qlik Community

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Working with logout API in mashup

All,

I am using a mashup with SAML authentication. Now I want to user to be able to logout via a button in the mashup. Could someone help me with the code I should use?

I found this page, but not sure how to use it exactly:

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

1 Solution

Accepted Solutions
konrad_mattheis
Luminary Alumni
Luminary Alumni

Hi Jeroen,

just use this:

DELETE -> {virtual proxy}/qps/user


You have to change the order it is at the moment wrong documented:


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


bye Konrad

View solution in original post

4 Replies
konrad_mattheis
Luminary Alumni
Luminary Alumni

Hi Jeroen,

just use this:

DELETE -> {virtual proxy}/qps/user


You have to change the order it is at the moment wrong documented:


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


bye Konrad

View solution in original post

Not applicable
Author

Hi Konrad,

I am afraid I am unfamiliar with using QPS API. How would I call this DELETE method using JavaScript? I tried the following but it gives an error:

var logoutbutton = function() {

   $.ajax({

   type: 'DELETE',

   url: 'https://<server>/<virtual directory>/qps/user?Xrfkey=0123456789abcdef',

   headers: {

        'X-Qlik-Xrfkey':'0123456789abcdef',

        'Content-Type':'application/json'

     }

   });

konrad_mattheis
Luminary Alumni
Luminary Alumni

Hi Jeroen,

please send it without Xrfkkey in URL and add no headers.

bye Konrad

Not applicable
Author

Hi Konrad,

Thanks, it was indeed easier than I thought!

For future reference this is my JS code:

var config = {

  host: window.location.hostname,

  prefix: prefix,

  port: window.location.port,

  isSecure: window.location.protocol === "https:"

};

var logoutbutton = function() {

   $.ajax({

   type: 'DELETE',

   url: 'https://' + config.host + config.prefix + 'qps/user'

   });

};

And this is my HTML code (logout & refresh page):

<a class="qcmd" onclick="logoutbutton();window.location.reload(true);">Logout</a>