Skip to content

Commit

Permalink
get cookie domain from proxy hostname if custom domain configured
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoshani committed Sep 19, 2024
1 parent bb230fe commit b941fbf
Showing 1 changed file with 5 additions and 1 deletion.
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 b941fbf

Please sign in to comment.