Skip to content

Commit

Permalink
Improve setting cookie path.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thisara-Welmilla committed Nov 14, 2023
1 parent ea4441a commit 0202e74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1503,15 +1503,15 @@ private void storeTokenIdCookie(String sessionId, HttpServletRequest req, HttpSe
if (IdentityTenantUtil.isTenantedSessionsEnabled() &&
sessionId.endsWith(SAMLSSOConstants.TENANT_QUALIFIED_TOKEN_ID_COOKIE_SUFFIX)) {
if (loggedInTenantDomain != null) {
if (!IdentityTenantUtil.isSuperTenantRequiredInUrl() &&
if (!IdentityTenantUtil.isSuperTenantAppendInCookiePath() &&
MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(loggedInTenantDomain)) {
samlssoTokenIdCookie.setPath(SAMLSSOConstants.COOKIE_ROOT_PATH);
} else {
samlssoTokenIdCookie.setPath(FrameworkConstants.TENANT_CONTEXT_PREFIX + loggedInTenantDomain +
SAMLSSOConstants.COOKIE_ROOT_PATH);
}
} else {
if (!IdentityTenantUtil.isSuperTenantRequiredInUrl() &&
if (!IdentityTenantUtil.isSuperTenantAppendInCookiePath() &&
MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
samlssoTokenIdCookie.setPath(SAMLSSOConstants.COOKIE_ROOT_PATH);
} else {
Expand Down Expand Up @@ -1571,7 +1571,7 @@ public void removeTokenIdCookie(HttpServletRequest req, HttpServletResponse resp
if (IdentityTenantUtil.isTenantedSessionsEnabled() && cookie.getValue() != null &&
cookie.getValue().endsWith(SAMLSSOConstants.TENANT_QUALIFIED_TOKEN_ID_COOKIE_SUFFIX)) {

if (!IdentityTenantUtil.isSuperTenantRequiredInUrl() &&
if (!IdentityTenantUtil.isSuperTenantAppendInCookiePath() &&
MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(loggedInTenantDomain)) {
samlSsoTokenIdCookie.setPath(SAMLSSOConstants.COOKIE_ROOT_PATH);
} else {
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.406</carbon.identity.framework.version>
<carbon.identity.framework.version>5.25.503</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 0202e74

Please sign in to comment.