cancel
Showing results for 
Search instead for 
Did you mean: 
Vadim_Pidgornyi
Sisense Team Member
Sisense Team Member

Redirecting Login Bypass Pages to the SSO Login Page

1. Open the File Management:
Navigate to `Admin -> App Configuration -> File Management`. If the "File Management" option is not available, enable it under `App Configuration -> Feature Management`.

2. Create the Plugin Folder:
Open the `serverSidePlugins` folder and create a new folder with a descriptive name, such as `loginPageRedirect`. Inside this folder, create an `index.js` file with the following code:

 

 

const ssoSettings = require(`${process.cwd()}/node_modules/@sisense/sisense-configuration`).sso;

module.exports = {
method: "GET",
url: [
"/app/account/login",
"/app/account"
],
beginRequest: (req, res, next) => {
if (ssoSettings.enabled) {
const host = encodeURIComponent(req.get('host'));
const { ssoType } = ssoSettings;
const redirectionUrl = (ssoType === 'jwt') ? ssoSettings.loginUrl :
(ssoType === 'saml') ? `/saml?address=${host}` : `/openid?return_to=${host}`;
res.redirect(redirectionUrl);
} else {
next();
}
}
};

 

 


3. Enable Server-Side Plugins:
Ensure that server-side plugins are enabled in the configuration settings. Navigate to `Admin -> Server & Hardware -> System Configuration -> Configuration -> Show Advanced Settings`. Check if the "Server Side Plugins Enable" feature is enabled.

4. Save and Verify:
Save the `index.js` file and verify that the server-side plugins are correctly enabled. This setup ensures that any attempt to bypass the login by using the workaround links will redirect users to the SSO login page, enhancing your security measures.

Check out this related content: 

Academy Course 

Sisense Documentation

Rate this article:
Version history
Last update:
‎08-20-2024 01:47 PM
Updated by: