From 6416f39dcac540d019fcad6ff765f491abec711b Mon Sep 17 00:00:00 2001 From: JeethJJ Date: Thu, 18 Jan 2024 11:51:15 +0530 Subject: [PATCH] Add proxy port and protocol to variables. --- .../identity/recovery/connector/RecoveryConfigImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/connector/RecoveryConfigImpl.java b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/connector/RecoveryConfigImpl.java index 2085bfcd3a..32435975b0 100644 --- a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/connector/RecoveryConfigImpl.java +++ b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/connector/RecoveryConfigImpl.java @@ -235,6 +235,8 @@ public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityG String enableAdminPasswordResetAutoLoginProperty = "false"; String recoveryMaxFailedAttempts = "3"; String recoveryMaxResendAttempts = "5"; + int httpsProxyPort = 443; + String secureHttpProtocol = "https"; String notificationBasedPasswordRecovery = IdentityUtil.getProperty( IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_BASED_PW_RECOVERY); @@ -362,11 +364,11 @@ public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityG if (StringUtils.isNotEmpty(recoveryCallbackRegexProperty)) { try { int proxyPort = ServiceURLBuilder.create().build().getPort(); - if (proxyPort == 443 && recoveryCallbackRegexProperty.contains("https") - && recoveryCallbackRegexProperty.contains(":443\\")) { + if (proxyPort == httpsProxyPort && recoveryCallbackRegexProperty.contains(secureHttpProtocol) + && recoveryCallbackRegexProperty.contains(":" + httpsProxyPort + "\\")) { // remove 443 if added to the regex since it's the proxy port. recoveryCallbackRegexProperty = recoveryCallbackRegexProperty + "|" + - recoveryCallbackRegexProperty.replace(":443\\", "\\"); + recoveryCallbackRegexProperty.replace(":" + httpsProxyPort + "\\", "\\"); } } catch (URLBuilderException e) { throw new IdentityGovernanceException(e);