var nonE2eeVoluntaryTarget = '/form/72E40D1A35EE4E708102D97974197E85'; if (window.portal == null) window.portal = {}; if (portal.page == null) portal.page = {}; portal.page.strings = { headerTitle: 'CitiDirect ®', headerLogoText: 'Citi Logo', changePasswordTitle: 'Password Change Request', changePasswordPanelSuggestion1: 'Please enter your current password then propose a new password and confirm before continuing.', changePasswordPanelSuggestion2: 'Please enter Login ID and current password then propose new password and confirm before continuing.', changePasswordPanelSuggestion3: 'You will be required to log in again after successfully changing your password, for security purposes.', loginIdLabel: 'Login ID', oldPasswordLabel: 'Old Password', newPasswordLabel: 'New Password', confirmPasswordLabel: 'Confirm New Password', complexity1: 'Minimum password length is 8 characters', complexity2: 'Maximum password length is 15 characters', complexity3: 'Maximum repeating character length is 2', complexity4: 'Password must contain at least 1 alpha and 1 numeric value', complexity5: 'Password must not contain the Login ID', complexity6: 'Password must contain at least 1 uppercase and 1 lowercase value', complexity7: 'Maximum sequential character length is 3', complexity8: 'Password must not contain bank names such as \'Citi\',\'Citigroup\',\'Citibank\',\'Citibanamex\',\'Banamex\'', ArgentinaText: 'For all users in Argentina, the minimum password length is 8 characters.', changePasswordAction: 'Change Password', cancelAction: 'Cancel', footerCitigroup: 'Citigroup.com', footerPrivacy: 'Privacy', footerTerms: 'Terms & Conditions', footerCopyright: 'Copyright © 2007 - 2024 Citigroup Inc.', privacyUrl: 'http://www.citigroup.com/citi/privacy/index.htm', termsUrl: 'http://www.citigroup.com/citi/privacy/terms.htm', changePasswordComplete: 'Your new password has been set. Please use this new password the next time you login.', validationWallTitle: 'Error(s). Please rectify the following to proceed:', requiredLoginId : 'Login ID is required. Please enter your Login ID.', requiredOldPassword : 'Old password is required. Please enter your old password.', requiredNewPassword : 'New password is required. Please enter your new password.', requiredConfirmPassword : 'Confirmation password is required. Please enter your confirmation password.', matchOldAndNewPassword : 'Please match your new password and confirmation.', passwordComplexityCheckFailed : 'The new password does not meet the complexity required. Please retry.', newPasswordMustBeDifferent: 'We were not able to change your password for one of the following reasons:', authReasonNone: 'Please enter credentials.', authReasonUnknownUser: 'Invalid Login ID or credentials.', authReasonPasswordChangeRequired: 'Please change your password.', authReasonChangeFailed: 'Change password failed.', authReasonSetRequired: 'New password setup required.', authReasonSetFailed: 'Set password failed.', authReasonSuccess: 'Your new password has been set. Please use this new password the next time you login.', authReasonUserSuspended: 'User is suspended.', authReasonUserRevoked: 'User is revoked.', authReasonNextTokenCode: 'Next OTP required.', authReasonExpired: 'Password expired. Please change your password.', authReasonAlreadyUsed: 'We were not able to change your password for one of the following reasons:', authReasonNotAccepted: 'We were not able to change your password for one of the following reasons:', authReasonMaxExceeded: 'Maximum number of password changes exceeded.', authReasonServerException: 'The password could not be changed because the User ID and Old Password do not match or because the User ID does not exist. If you think you received this message in error, please contact your Security Manager or Citi Service Representative.', authReasonUnknownScheme: 'Server scheme exception.', passwordTipsInfo: 'Password Tips', passwordPersonalInfo: 'Do not use your personal information (name, address, email, phone, etc.) as a password.
Your password cannot be one of the last six that you’ve used.' }; $(function(){ document.Login.PASSWORD.value = ""; document.Login.NEWPASSWORD.value=""; document.Login.CONFIRMATION.value = ""; var strings = portal.page.strings; $('#header-portal-logo').attr('alt', strings.headerLogoText).attr('title', strings.headerLogoText); for(var p in strings) { if(p=='changePasswordPanelSuggestion3' && IsNonE2ee()) continue; var $target = $('#page-strings-'+p); var str = strings[p]; if($target.is('input')) $target.val(str); else $target.html(str); } if ($('#loginId').val() == '') $('#loginId').focus(); else $('#oldPassword').focus(); if(window.authReason == 23) { $('#Login').hide(); alert(strings.changePasswordComplete); //Send user email notification after changing the password $.ajax({ type:"POST", url:"/portalservices/scripts/strings/ChangePasswordJs.aspx/sendUseremailNotification", dataType: "json", contentType: "application/json; charset=utf-8" }); if(document.Login.target.value == nonE2eeVoluntaryTarget) voluntaryChangeCompleteAction(); else changeCompleteAction(); removepwdchangeCookiesInPortalDomain('.citidirect.com'); return; } var message = getMessage(window.authReason); if(message != '') { if(window.authReason ==22) $("#errorsContainer").css({ 'list-style-type': "none" }); showErrorWall([message]); } }); function newPasswordChanged() { var newPassword = $('#newPassword').val(); $('.password-rule').each(function(){ var $this = $(this); $this.removeClass('passed').css({color:'red'}); var pattern = $this.attr('pattern'); var negative = $this.attr('negative')=='true'; if(pattern) { var r = new RegExp(pattern); var match = r.test(newPassword); if((match && !negative) || (!match && negative)) $this.addClass('passed').css({color:'green'}); } else { var fn = $this.attr('function'); if(fn && window[fn]) { if(window[fn]()) $this.addClass('passed').css({color:'green'}); } } }); } function checkPasswordDoesNotContainLoginId() { var newPassword = $('#newPassword').val(); var loginId = $('#loginId').val(); try{ if(loginId == '') return true; return (newPassword.toLowerCase().indexOf(loginId.toLowerCase()) == -1) } catch(x) { } return false; } function checkPasswordDoesNotContainSequence() { var newPassword = $('#newPassword').val(); try{ var sequencePattern = new RegExp("([a-zA-Z0-9])\\1\\1+|(abcd|bcde|cdef|defg|efgh|fghi|ghij|hijk|ijkl|jklm|klmn|lmno|mnop|nopq|opqr|pqrs|qrst|rstu|stuv|tuvw|uvwx|vwxy|wxyz|0123|1234|2345|3456|4567|5678|6789|7890)+"); if (!sequencePattern.test(newPassword.toLowerCase())) { return true; } } catch(x) { } return false; } function checkPasswordDoesNotContainBankName() { var newPassword = $('#newPassword').val(); try{ if (!newPassword.toLowerCase().includes("citi") && !newPassword.toLowerCase().includes("citigroup") && !newPassword.toLowerCase().includes("citibank") && !newPassword.toLowerCase().includes("citibanamex") && !newPassword.toLowerCase().includes("banamex")) { return true; } } catch(x) { } return false; } function getMessage(authreason){ var strings = portal.page.strings; switch(authreason) { case 0: return strings.authReasonNone; case 6: return strings.authReasonUnknownUser; //case 1: return strings.authReasonPasswordChangeRequired; case 21: return strings.authReasonChangeFailed; case 29: return strings.authReasonSetRequired; case 20: return '';//strings.authReasonSetFailed; //case 23: return strings.authReasonSuccess; case 24: return strings.authReasonUserSuspended; case 7: return strings.authReasonUserRevoked; case 28: return strings.authReasonNextTokenCode; case 19: return strings.authReasonExpired; //case 22: return strings.authReasonAlreadyUsed; case 50: return strings.authReasonMaxExceeded; case 35: return strings.authReasonServerException; case 36: return strings.authReasonUnknownScheme; } if(IsNonE2ee()) { switch(authreason) { //case 22: return 'Your password change was not accepted. '+window.smMessage+' Please try again. '; case 22: return strings.authReasonNotAccepted; } } else { switch(authreason) { case 22: return strings.authReasonAlreadyUsed; } } return ''; } var isLocked = false; function validatePasswordConfirmation($e, v) { if(v != $('#newPassword').val()) return false; return true; } function validatePasswordComplexity($e, v) { var c = e2epwcheck(v); if(c!=0) return false; if(!checkPasswordDoesNotContainLoginId()) return false; if(!checkPasswordDoesNotContainSequence()) return false; if(!checkPasswordDoesNotContainBankName()) return false; return true; } function validateNewPasswordMustBeDifferent($e, v) { if(v == $('#oldPassword').val()) { $("#errorsContainer").css({ 'list-style-type': "none" }); return false; } return true; } function removepwdchangeCookiesInPortalDomain(domain) { var PortalPwdChangeUserId = Get_Cookie('PortalPwdChangeUserId'); if (PortalPwdChangeUserId != null) Set_Cookie("PortalPwdChangeUserId", "", -1, '/', domain, ''); } function IsNonE2ee() { return (location.href.toLowerCase().indexOf('/smpwservices.fcc') > -1); } function submitForm() { if(!validateForm()) return false; if (isLocked) return false; document.Login.USERNAME.value = document.Login.PRE_USERNAME.value; document.Login.PASSWORD.value = document.Login.PRE_PASSWORD.value; var altuid = document.Login.USERNAME.value; var PortalCookieDomain= '.citidirect.com'; if(PortalCookieDomain=='') Set_Cookie("PortalPwdChangeUserId", altuid, 30, '/', '', ''); else Set_Cookie("PortalPwdChangeUserId", altuid, 30, '/', PortalCookieDomain, ''); isLocked = true; if(IsNonE2ee()) getE2eeStatusComplete(altuid, null, 1); else getE2eeStatus(altuid); } function getE2eeStatus(altuid) { var tempuid=Conceal(altuid); var PortalCookieDomain= '.citidirect.com'; if(PortalCookieDomain=='') Set_Cookie("AuditUserId", tempuid, 30, '/', '', ''); else Set_Cookie("AuditUserId", tempuid, 30, '/', PortalCookieDomain, ''); $.post( '/portalservices/jsonpages/gete2eestatus.aspx', { }, function (json) { r = eval('(' + json + ')'); if (!r.success) { document.Login.action = '/siteminderagent/forms/failedlogin.pser'; document.Login.submit(); return; } getE2eeStatusComplete(altuid, r.E2eeUser, r.status); } ); } function getE2eeStatusComplete(altuid, userId, e2eeStatus) { if(e2eeStatus==3) { if(String(e2ee.IsGeCASEnabled).toLowerCase()=="true") { $.ajax({ type: "POST", url: "/siteminderagent/forms/CASlogin.fcc", async:false, data: { USER: userId, FUNCTION: "3" ,target : "/e2ee-gcas"}, success: function(result) { var salt1=String(result).match(/#1(.*)#1/)[1]; var salt2=String(result).match(/#2(.*)#2/)[1]; var sid=String(result).match(/#3(.*)#3/)[1]; var Exponent = e2ee.Exponent; var Modulus = e2ee.Modulus; var PwdValue = document.Login.PASSWORD.value; var NewPwdValue = document.Login.NEWPASSWORD.value; var rsaLoginBlock = encryptChangePwdNoVerifyRSABlock256(Exponent, Modulus, userId, PwdValue, NewPwdValue, salt1,salt2); document.Login.USERNAME.value = userId; document.Login.PASSWORD.value = rsaLoginBlock; document.Login.OTP.value=""; document.Login.PRE_PASSWORD.value = ""; document.Login.NEWPASSWORD.value=""; document.Login.CONFIRMATION.value = ""; document.Login.action = '/siteminderagent/forms/CASchange.fcc' + '?PUBMOD=' + Modulus + '&PUBEXP=' + Exponent + '&SALT_1='+salt1+'&SALT_1='+salt2+'&CASAUTHREASON=0&KEYNAME=E2ee_RSA_key&SESSIONID='+sid+'&target=/e2ee-gcas'; document.Login.target.value = '/e2ee-gcas'; }, error: function(error){document.Login.target.value = '/siteminderagent/forms/failedlogin.pser';} }); } else { var Random = e2ee.getRandom(); var Exponent = e2ee.Exponent; var Modulus = e2ee.Modulus; var PwdValue = document.Login.PASSWORD.value; var NewPwdValue = document.Login.NEWPASSWORD.value; var rsaLoginBlock = encryptChangePwdNoVerifyRSABlock256(Exponent, Modulus, userId, PwdValue, NewPwdValue, Random, Random); document.Login.USERNAME.value = userId; document.Login.PASSWORD.value = rsaLoginBlock; document.Login.PRE_PASSWORD.value = ""; document.Login.NEWPASSWORD.value=""; document.Login.CONFIRMATION.value = ""; document.Login.smauthreason.value = ""; document.Login.smagentname.value = ""; var target = '/e2ee/redirect.aspx'; if(window.voluntary) target = '/e2ee/changepassword.aspx'; if(location.href.toLowerCase().indexOf('/2fa/') > -1) target = '/mfae2ee/redirect.aspx'; document.Login.action = '/siteminderagent/forms/ds3change.fcc' + '?PUBMOD=' + Modulus + '&PUBEXP=' + Exponent + '&TARGET='+target; document.Login.target.value = target; } } else { if(window.voluntary) { var target = nonE2eeVoluntaryTarget; document.Login.action = '/siteminderagent/forms/smpwservices.fcc' + '?TARGET='+target; document.Login.target.value = target; } } document.Login.submit(); } function cancelAction() { top.location.href = '/portalservices/forms/portallogoff.aspx'; } function voluntaryChangeCompleteAction() { top.location.href = '/portalservices/forms/portallogoff.aspx?target=/'; } function changeCompleteAction() { document.Login.target.value = '/form/redirect.aspx?target=/'; top.location.href='https://'+location.hostname+ ':' + location.port; } function ValueOrNull(v) { if(v) return v; return null; } function TryParseInt(v,d) { if ( isNaN(parseInt(v, 10 )) ) return d; else return parseInt(v, 10); }