cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
DownloadPost Message

Introduction

The following forum post explains how to log your users out of Sisense from your native application.

Purpose

Single sign-on (SSO) systems enable your users to authenticate themselves in your online services and then in Sisense with one authentication credential. After your users' session has ended, it is your responsibility to develop and implement the means of logging your users out of Sisense through your application.
For example, if your user is logged into Sisense through an embedded iFrame on your site or application and clicks a “Log Out” link on your site, your implementation must invoke the Sisense Logout API.
Note, your users' browser may prevent invoking the Sisense Logout API from your application because of CORS (Cross-Origin Resource Sharing). For more information about CORS, click here.
One way you can log your users out and overcome CORS is through the Post-Message method. The window.postMessage method securely enables cross-origin communication.
The Post-Message plugin attached to this post implements a listener for the windows.postMessage() method.
When the windows.postMessage() method is called, it triggers a MessageEvent in the browser. The Post-Message plugin listens for this event and calls the auth/logout method of the Sisense REST API, logging your user out of Sisense.  
Sisense logout endpoint (GET): 
/api/v1/authentication/logout
The postMessage() method takes two parameters:
message: A object to be sent to Sisense that should contain {logout:true}, so the plugin will be triggered only with this parameter included.
targetOrigin: The Sisense URL of the window that the message is being sent to including the HTTP heading and the port.
 
For example:
postMessage({logout:true},'http://localHost:8081');

Steps

1. Download the Zip file below and extract its files to \...\Sisense\PrismWeb\plugins. If you do not have this folder, create the \plugins folder and then extract the files to it. If you are using version 7.2 and higher unzip the contents into your C:\Program Files\Sisense\app\plugins\ folder. 
2. Develop the functionality in your site or application that implements the Post-Message plugin to call the logout method of the Sisense REST API.
Rate this article:
Version history
Last update:
‎06-17-2024 01:02 PM
Updated by:
Contributors