diff --git a/portals/admin/src/main/webapp/services/login/idp.jsp b/portals/admin/src/main/webapp/services/login/idp.jsp index 6383c98ef68..36087190ffb 100644 --- a/portals/admin/src/main/webapp/services/login/idp.jsp +++ b/portals/admin/src/main/webapp/services/login/idp.jsp @@ -121,6 +121,15 @@ dcrRequestData.put("grantType", "authorization_code refresh_token"); dcrRequestData.put("saasApp", true); + Object isJWTEnabledObj = Util.readJsonObj(settingsResponse, "IsJWTEnabledForLoginTokens"); + if (isJWTEnabledObj != null && isJWTEnabledObj instanceof Boolean) { + boolean isJWTEnabledForLoginTokens = (boolean) isJWTEnabledObj; + if (isJWTEnabledForLoginTokens) { + dcrRequestData.put("tokenType", "JWT"); + dcrRequestData.put("userStoreDomainInSubject", true); + } + } + HttpRequest postReq = HttpRequest.newBuilder() .uri(URI.create(dcrUrl)) .POST(HttpRequest.BodyPublishers.ofString(gson.toJson(dcrRequestData))) diff --git a/portals/devportal/src/main/webapp/services/login/idp.jsp b/portals/devportal/src/main/webapp/services/login/idp.jsp index 1bab1ba9425..ef8b114b5c9 100644 --- a/portals/devportal/src/main/webapp/services/login/idp.jsp +++ b/portals/devportal/src/main/webapp/services/login/idp.jsp @@ -131,6 +131,16 @@ dcrRequestData.put("owner", (String) APIUtil.getTenantAdminUserName(serviceProviderTenantDomain)); dcrRequestData.put("grantType", "authorization_code refresh_token"); dcrRequestData.put("saasApp", true); + + Object isJWTEnabledObj = Util.readJsonObj(settingsResponse, "IsJWTEnabledForLoginTokens"); + if (isJWTEnabledObj != null && isJWTEnabledObj instanceof Boolean) { + boolean isJWTEnabledForLoginTokens = (boolean) isJWTEnabledObj; + if (isJWTEnabledForLoginTokens) { + dcrRequestData.put("tokenType", "JWT"); + dcrRequestData.put("userStoreDomainInSubject", true); + } + } + log.debug(dcrRequestData); HttpRequest postReq = HttpRequest.newBuilder() .uri(URI.create(dcrUrl)) diff --git a/portals/publisher/src/main/webapp/services/login/idp.jsp b/portals/publisher/src/main/webapp/services/login/idp.jsp index 203b11fde88..fc5dcb6b825 100644 --- a/portals/publisher/src/main/webapp/services/login/idp.jsp +++ b/portals/publisher/src/main/webapp/services/login/idp.jsp @@ -148,6 +148,15 @@ dcrRequestData.put("grantType", "authorization_code refresh_token"); dcrRequestData.put("saasApp", true); + Object isJWTEnabledObj = Util.readJsonObj(settingsResponse, "IsJWTEnabledForLoginTokens"); + if (isJWTEnabledObj != null && isJWTEnabledObj instanceof Boolean) { + boolean isJWTEnabledForLoginTokens = (boolean) isJWTEnabledObj; + if (isJWTEnabledForLoginTokens) { + dcrRequestData.put("tokenType", "JWT"); + dcrRequestData.put("userStoreDomainInSubject", true); + } + } + HttpRequest postReq = HttpRequest.newBuilder() .uri(URI.create(dcrUrl)) .POST(HttpRequest.BodyPublishers.ofString(gson.toJson(dcrRequestData)))