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

Fix issue in setting root path for cookies when tenant qualified url enabled #407

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -1503,11 +1503,21 @@ private void storeTokenIdCookie(String sessionId, HttpServletRequest req, HttpSe
if (IdentityTenantUtil.isTenantedSessionsEnabled() &&
sessionId.endsWith(SAMLSSOConstants.TENANT_QUALIFIED_TOKEN_ID_COOKIE_SUFFIX)) {
if (loggedInTenantDomain != null) {
samlssoTokenIdCookie.setPath(FrameworkConstants.TENANT_CONTEXT_PREFIX + loggedInTenantDomain +
SAMLSSOConstants.COOKIE_ROOT_PATH);
if (!IdentityTenantUtil.isSuperTenantRequiredInUrl() &&
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 {
samlssoTokenIdCookie.setPath(FrameworkConstants.TENANT_CONTEXT_PREFIX + tenantDomain +
SAMLSSOConstants.COOKIE_ROOT_PATH);
if (!IdentityTenantUtil.isSuperTenantRequiredInUrl() &&
MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
samlssoTokenIdCookie.setPath(SAMLSSOConstants.COOKIE_ROOT_PATH);
} else {
samlssoTokenIdCookie.setPath(FrameworkConstants.TENANT_CONTEXT_PREFIX + tenantDomain +
SAMLSSOConstants.COOKIE_ROOT_PATH);
}
}
isTenantQualifiedCookie = true;
} else {
Expand Down Expand Up @@ -1560,8 +1570,14 @@ public void removeTokenIdCookie(HttpServletRequest req, HttpServletResponse resp
boolean isTenantQualifiedCookie = false;
if (IdentityTenantUtil.isTenantedSessionsEnabled() && cookie.getValue() != null &&
cookie.getValue().endsWith(SAMLSSOConstants.TENANT_QUALIFIED_TOKEN_ID_COOKIE_SUFFIX)) {
samlSsoTokenIdCookie.setPath(FrameworkConstants.TENANT_CONTEXT_PREFIX + loggedInTenantDomain +
SAMLSSOConstants.COOKIE_ROOT_PATH);

if (!IdentityTenantUtil.isSuperTenantRequiredInUrl() &&
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);
}
isTenantQualifiedCookie = true;
} else {
samlSsoTokenIdCookie.setPath(SAMLSSOConstants.COOKIE_ROOT_PATH);
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.380</carbon.identity.framework.version>
<carbon.identity.framework.version>5.25.406</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
Loading