/** * * SSOLoginUIView * * shishir.tandale 10/24/2024 **/ (function(){ jQuery.noConflict(); jQuery(document).ready(function() { init(); }); const ssoHomePageUrl = "https://hhs-ecape-portal-sso.entellitrak.com/"; const ssoSupportUrl = "https://help.id.me/hc/en-us/"; const ssoCutoverDate = "02/15/2025"; const isSsoEnabled = "true" === "true"; const isSsoEnforced = "" === "true"; const isSsoSoftLaunch = isSsoEnabled && !isSsoEnforced; const isSsoHardLaunch = isSsoEnabled && isSsoEnforced; const signInWithIdMeLabel = "Create Account or Sign in with ID.me"; const confirmSsoLoginMessage = "Once you create an ID.me account, you will use ID.me to login to the e-Appeal Portal. You will no longer be able to login with your previous username and password."; const invalidAuthTypeMessage = "You can no longer sign in with your previous username and password because your Portal account has now been linked to an ID.me account. Please sign in to the Portal with your new credentials by clicking on the '"+signInWithIdMeLabel+"' button."; const ssoInstructions = "We are transitioning to ID.me for enhanced security. During this transition, you can continue using your current username and password until you sign up with ID.me. The full transition will be completed by "+ssoCutoverDate+". Please stay tuned for further updates."; const ssoHardLaunchInstructions = "We have transitioned to ID.me for enhanced security. You can no longer use your e-Appeal Portal username and password. Please create an account or sign in with ID.me."; const isLoginSubmitForm = window.location.pathname.endsWith("login.submit.do"); const isLoginRequestForm = window.location.pathname.endsWith("login.request.do"); const isSsoLoginForm = window.location.pathname.endsWith("login.sso.submit.do"); function init() { if(isSsoEnabled) { addSsoButton(); addSsoMessaging(); checkAndReplaceErrorMessage(); } else { jQuery("#submit").after(""); } if(isSsoHardLaunch) { removeLocalAuthLoginForm(); moveSecurityNotice(); } } function removeLocalAuthLoginForm() { jQuery('#login form[name="signonForm"]').remove(); } function moveSecurityNotice() { jQuery("#security-policy").appendTo("#login") } function checkAndReplaceErrorMessage() { if(isLoginSubmitForm) { const msgElement = jQuery("#signonFailure"); if(msgElement.length === 1) { const errorMessage = msgElement.text().trim(); if(errorMessage === 'Your account has an invalid authentication type configured. Please contact the System Administrator.') { msgElement.remove(); etk.ui.dialog.open({ id: "invalidSignIn", title: "Invalid Sign In", body: invalidAuthTypeMessage, modal: true, buttons: [ { text: "OK", click: function() { } }, ] }); } } } } function addSsoMessaging() { if(isLoginSubmitForm || isLoginRequestForm) { jQuery("#ssoButtonContainer").after("
"); if(isSsoSoftLaunch) { jQuery("#loginLabelContainer").append("OR"); jQuery("#loginLabelContainer").append("e-Appeal Portal Account"); } jQuery('form[name="signonForm"]').after("
"); if(isSsoSoftLaunch) { jQuery("#ssoInstructions").append("

"+ssoInstructions+"

"); } if(isSsoHardLaunch) { jQuery("#ssoInstructions").append("

"+ssoHardLaunchInstructions+"

"); } jQuery("#ssoInstructions").append("

Trouble Signing In?

If you're having issues with signing in or setting up MFA through ID.me, we're here to assist.

"); } } function addSsoButton() { if(isLoginSubmitForm || isLoginRequestForm) { //jQuery("#policy").after("
"); jQuery("#policy").after("
"); jQuery("#ssoButtonContainer").append(''); jQuery("#ssoButtonContainer > *").on('click', ssoLogin); } } function ssoLogin() { if(isSsoHardLaunch) { window.location.href = ssoHomePageUrl; return; } if(isSsoSoftLaunch) { etk.ui.dialog.open({ id: "ssoLoginConfirm", title: "Welcome", body: confirmSsoLoginMessage, modal: true, buttons: [ { text: "Proceed to ID.me", click: function() { window.location.href = ssoHomePageUrl } }, { text: "Cancel", click: function() { } } ] }); } } })();