Skip to content

Commit

Permalink
Merge pull request #6901 from Yoshani/master
Browse files Browse the repository at this point in the history
Get cookie domain from proxy hostname if custom domain configured
  • Loading branch information
Yoshani committed Sep 19, 2024
2 parents 70ce904 + 27597ab commit 61d0b50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/honest-zoos-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/identity-apps-core": patch
---

set proxy hostname as cookie domain when branded
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<%@ page import="org.owasp.encoder.Encode" %>
<%@ page import="org.wso2.carbon.core.SameSiteCookie" %>
<%@ page import="org.wso2.carbon.core.util.SignatureUtil" %>
<%@ page import="org.wso2.carbon.identity.core.ServiceURLBuilder" %>
<%@ page import="org.wso2.carbon.identity.mgt.constants.SelfRegistrationStatusCodes" %>
<%@ page import="org.wso2.carbon.identity.mgt.endpoint.util.IdentityManagementEndpointConstants" %>
<%@ page import="org.wso2.carbon.identity.mgt.endpoint.util.IdentityManagementServiceUtil" %>
Expand Down Expand Up @@ -358,7 +359,10 @@
} else {
tenantAwareUsername = username + "@" + user.getTenantDomain();
}
String cookieDomain = application.getInitParameter(AUTO_LOGIN_COOKIE_DOMAIN);
String domainName = application.getInitParameter(AUTO_LOGIN_COOKIE_DOMAIN);
String hostName = ServiceURLBuilder.create().build().getProxyHostName();
String cookieDomain = IdentityUtil.isSubdomain(domainName, hostName) ? domainName : hostName;
JSONObject contentValueInJson = new JSONObject();
contentValueInJson.put("username", tenantAwareUsername);
contentValueInJson.put("createdTime", System.currentTimeMillis());
Expand Down

0 comments on commit 61d0b50

Please sign in to comment.