Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary portal app callback for support organization qualified URLs #7030

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/early-chairs-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/identity-apps-core": patch
---

Remove unnecessary org qualified callback url regex for portal apps
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading