overview
SSO Integration Behavior โ Homepage
This document outlines the logic implemented in home_page.js
to handle SSO-based logins and SSO-related error messages dynamically based on URL parameters.
๐ SSO Login Detection via URL
โ Condition:
Checks if the URL contains the following string:
so=enc566X4Mf6vl9i72WFDwrrtw==
๐ง Action on Detection:
If matched, the system treats the user as an SSO user and applies the following updates:
1. Set SSO User Flag:
this.productDataObj.ssoUser = true;
2. Update Navbar Login Label:
Finds the login label and modifies it:
const index = this.productDataObj.DepartmentData['sha-pg001'].BeforeLoginItemArr.map(item => item.Name).indexOf("Login");
const index1 = this.productDataObj.DepartmentData['sha-pg001'].BeforeLoginItemArr.map(item => item.MName).indexOf("Log Masuk");
if(index > 0){
this.productDataObj.DepartmentData['sha-pg001'].BeforeLoginItemArr[index].Name = 'eProcurement Portal Login';
this.productDataObj.DepartmentData['sha-pg001'].BeforeLoginItemArr[index].MName = 'Log Masuk Portal ePerolehan';
this.productDataObj.DepartmentData['sha-pg001'].BeforeLoginItemArr[index].ExternalLink = 'https://www.tenderwizardaccept.com/ROOTAPP/servlet/GetOTPAjaxController?encvalJ=QWN0aXZpdHk9U1NPX1VTRVJfVkFMSURBVElPTg==';
this.productDataObj.DepartmentData['sha-pg001'].BeforeLoginItemArr[index].RouteName = '';
}
3. Update Page Labels:
this.pageLabels.Login = "eProcurement Portal Login";
this.pageLabels.MLogin = "Log Masuk Portal ePerolehan";
4. Add "Login as Administrator" to Important Links:
let b;
for(let i=0; i<this.deptLabels.ImportantLinks.DataArr.length; i++){
if(this.deptLabels.ImportantLinks.DataArr[i].Title === 'Login as Adminstrator'){
b = 1;
break;
} else {
b = 0;
}
}
if(b == 0){
let link = window.location.href;
let str = link.substring(0, link.length - 4);
let a = {
Title: 'Login as Adminstrator',
Link: str + "login"
}
let a1 = {
Title: 'Log masuk sebagai Pentadbir',
Link: str + "login"
}
this.deptLabels.ImportantLinks.DataArr.push(a);
if(this.deptLabels.MImportantLinks){
this.deptLabels.MImportantLinks.DataArr.push(a1);
}
}
This code checks if "Login as Administrator" is already in the homepage's Important Links. If not, it:
Constructs a login link based on the current URL.
Adds it to both English and Malay link arrays.
Ensures the link points to /login and is only added once.
5. Set Login Routing:
this.deptLabels.LoginRoute = '';
this.deptLabels.ExternalLinks.Login = 'https://www.tenderwizardaccept.com/ROOTAPP/servlet/GetOTPAjaxController?encvalJ=QWN0aXZpdHk9U1NPX1VTRVJfVkFMSURBVElPTg==';
โ SSO Error Message Handling
โ Condition:
Checks if the URL contains any of the following error parameters:
if (bdabbsr.includes("ssoerrormsg=error")) {
this.ssoErrorMsgPopup("error");
}else if(bdabbsr.includes("ssoerrormsg=blacklisted")){
this.ssoErrorMsgPopup("blacklisted");
}else if(bdabbsr.includes("ssoerrormsg=disableflagN")){
this.ssoErrorMsgPopup("disableflagN");
}else if(bdabbsr.includes("ssoerrormsg=SUSPENDED")){
this.ssoErrorMsgPopup("SUSPENDED");
}else if(bdabbsr.includes("ssoerrormsg=multipleusers")){
this.ssoErrorMsgPopup("multipleusers");
}
๐ฌ Supported Messages:
ssoerrormsg Value | Dialog Message |
---|---|
error | "Your profile is not registered with TenderWizard" and registration links. |
blacklisted | "Sorry, you are not able to log on, as you are blacklisted." |
disableflagN | "Your Login is Disabled. Contact Administrator." |
SUSPENDED | "Your Login is SUSPENDED. Contact Administrator." |
multipleusers | "You are not allowed to log-in by SSO. Please contact department helpdesk." |
๐ Notes
- This logic is executed in the
attached()
lifecycle method of theHomePageCls
. - URL string is stored in
bdabbsr = window.location.href
.
๐ Related Function:
ssoErrorMsgPopup(_val)
- Opens custom popup dialogs based on the provided error code.
home_page.js
๐ File: Located under the root app's
/Mobility
module structure.