Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
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
Partner - Creator III
Partner - Creator III

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

5 Replies
konrad_mattheis
Partner - Creator III
Partner - Creator III

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

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
Partner - Creator III
Partner - Creator III

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>

S427
Contributor II
Contributor II

Hi Konrad & Jeroen,

By this code we are able to logout from Qlik not from mashup. right? If we want to logout from mashup then what all changes we need to do?