Skip to content

Commit

Permalink
Improve tenant resolving with tenant qualified URL enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thisara-Welmilla committed Oct 16, 2023
1 parent 36b8d06 commit d609ee0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.opensaml.saml.saml2.core.Response;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.identity.core.model.SAMLSSOServiceProviderDO;
import org.wso2.carbon.identity.core.util.IdentityTenantUtil;
import org.wso2.carbon.identity.core.util.IdentityUtil;
import org.wso2.carbon.identity.query.saml.QueryResponseBuilder;
import org.wso2.carbon.identity.query.saml.exception.IdentitySAML2QueryException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private String getLoggedInTenantDomainFromEvent(Event event) {
}

if (StringUtils.isBlank(loggedInTenantDomain)) {
loggedInTenantDomain = IdentityTenantUtil.getTenantDomainFromContext();
loggedInTenantDomain = IdentityTenantUtil.resolveTenantDomain();
}
return loggedInTenantDomain;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public SAMLSSOReqValidationResponseDTO invalidateSession(String sessionId) throw

String loginTenantDomain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
if (IdentityTenantUtil.isTenantedSessionsEnabled()) {
loginTenantDomain = IdentityTenantUtil.getTenantDomainFromContext();
loginTenantDomain = IdentityTenantUtil.resolveTenantDomain();
}
SPInitLogoutRequestProcessor logoutReqProcessor = SAMLSSOUtil.getSPInitLogoutRequestProcessor();
return logoutReqProcessor.process(null, sessionId, null, loginTenantDomain);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private String getLoggedInTenantDomain() {
if (!IdentityTenantUtil.isTenantedSessionsEnabled()) {
return getTenantDomain();
}
return IdentityTenantUtil.getTenantDomainFromContext();
return IdentityTenantUtil.resolveTenantDomain();
}

private Optional<AuthenticatedUser> getLoggedInUser(String tenantDomain) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private void handleRequest(HttpServletRequest req, HttpServletResponse resp, boo

String tenantDomain = null;
if (IdentityTenantUtil.isTenantQualifiedUrlsEnabled()) {
tenantDomain = IdentityTenantUtil.getTenantDomainFromContext();
tenantDomain = IdentityTenantUtil.resolveTenantDomain();
if (log.isDebugEnabled()) {
log.debug("Tenant domain from context: " + tenantDomain);
}
Expand Down Expand Up @@ -2243,7 +2243,7 @@ private String getLoggedInTenantDomain(HttpServletRequest req) {

String loggedInTenantDomain = req.getParameter(FrameworkConstants.RequestParams.LOGIN_TENANT_DOMAIN);
if (StringUtils.isBlank(loggedInTenantDomain)) {
return IdentityTenantUtil.getTenantDomainFromContext();
return IdentityTenantUtil.resolveTenantDomain();
}
return loggedInTenantDomain;
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@
<properties>
<carbon.kernel.version>4.9.10</carbon.kernel.version>
<carbon.kernel.feature.version>4.9.0</carbon.kernel.feature.version>
<carbon.identity.framework.version>5.25.305</carbon.identity.framework.version>
<carbon.identity.framework.version>5.25.380</carbon.identity.framework.version>
<carbon.identity.framework.imp.pkg.version.range>[5.25.260, 7.0.0)
</carbon.identity.framework.imp.pkg.version.range>
<carbon.identity.organization.management.core.version>1.0.0</carbon.identity.organization.management.core.version>
Expand Down

0 comments on commit d609ee0

Please sign in to comment.