From 422df7d4778e07ebd3ff5d9c0d2fc8e0929659a8 Mon Sep 17 00:00:00 2001 From: sadilchamishka Date: Thu, 24 Oct 2024 09:35:34 +0530 Subject: [PATCH 1/2] Remove unnecessary org qualified callback url regex for portal apps --- .../apps/common/util/AppPortalUtils.java | 33 +++++-------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/identity-apps-core/components/org.wso2.identity.apps.common/src/main/java/org/wso2/identity/apps/common/util/AppPortalUtils.java b/identity-apps-core/components/org.wso2.identity.apps.common/src/main/java/org/wso2/identity/apps/common/util/AppPortalUtils.java index f3bbf917535..bc370139631 100644 --- a/identity-apps-core/components/org.wso2.identity.apps.common/src/main/java/org/wso2/identity/apps/common/util/AppPortalUtils.java +++ b/identity-apps-core/components/org.wso2.identity.apps.common/src/main/java/org/wso2/identity/apps/common/util/AppPortalUtils.java @@ -135,32 +135,15 @@ public static void createOAuth2Application(String applicationName, String portal throw new IdentityOAuthAdminException("Server encountered an error while building callback URL with " + "placeholders for the server URL", e); } - if (CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME) { - if (SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) { - if (StringUtils.equals(CONSOLE_APP, applicationName) && - AppsCommonDataHolder.getInstance().isOrganizationManagementEnabled()) { - callbackUrl = "regexp=(" + callbackUrl - + "|" + callbackUrl.replace(portalPath, "/t/(.*)" + portalPath) - + "|" + callbackUrl.replace(portalPath, "/o/(.*)" + portalPath) - + ")"; - } else { - callbackUrl = "regexp=(" + callbackUrl - + "|" + callbackUrl.replace(portalPath, "/t/(.*)" + portalPath) - + ")"; - } - } + if (SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) { + callbackUrl = "regexp=(" + callbackUrl + + "|" + callbackUrl.replace(portalPath, "/t/carbon.super" + portalPath) + + "|" + callbackUrl.replace(portalPath, "/t/carbon.super/o/(.*)" + portalPath) + + ")"; } else { - if (SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) { - callbackUrl = "regexp=(" + callbackUrl - + "|" + callbackUrl.replace(portalPath, "/o/(.*)" + portalPath) - + "|" + callbackUrl.replace(portalPath, "/t/carbon.super" + portalPath) - + "|" + callbackUrl.replace(portalPath, "/t/carbon.super/o/(.*)" + portalPath) - + ")"; - } else { - callbackUrl = "regexp=(" + callbackUrl.replace(portalPath, "/t/(.*)" + portalPath) - + "|" + callbackUrl.replace(portalPath, "/t/(.*)/o/(.*)" + portalPath) - + ")"; - } + callbackUrl = "regexp=(" + callbackUrl.replace(portalPath, "/t/(.*)" + portalPath) + + "|" + callbackUrl.replace(portalPath, "/t/(.*)/o/(.*)" + portalPath) + + ")"; } oAuthConsumerAppDTO.setCallbackUrl(callbackUrl); oAuthConsumerAppDTO.setBypassClientCredentials(true); From d8ac25af8c462eac2d2bb5c949f32996ad83a000 Mon Sep 17 00:00:00 2001 From: sadilchamishka Date: Thu, 24 Oct 2024 09:36:44 +0530 Subject: [PATCH 2/2] =?UTF-8?q?Add=20changeset=20=F0=9F=A6=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/early-chairs-impress.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/early-chairs-impress.md diff --git a/.changeset/early-chairs-impress.md b/.changeset/early-chairs-impress.md new file mode 100644 index 00000000000..38182ccbcb6 --- /dev/null +++ b/.changeset/early-chairs-impress.md @@ -0,0 +1,5 @@ +--- +"@wso2is/identity-apps-core": patch +--- + +Remove unnecessary org qualified callback url regex for portal apps