From 1f6c668f5b28b9d1678b5ebd2abd61b7b31cac8e Mon Sep 17 00:00:00 2001 From: dhaura Date: Mon, 29 Jul 2024 15:18:28 +0530 Subject: [PATCH] Add restrictToPublished param as true in order to obtain the nearest published branding at runtime. --- .../util/client/BrandingPreferenceRetrievalClient.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/identity-mgt/org.wso2.carbon.identity.mgt.endpoint.util/src/main/java/org/wso2/carbon/identity/mgt/endpoint/util/client/BrandingPreferenceRetrievalClient.java b/components/identity-mgt/org.wso2.carbon.identity.mgt.endpoint.util/src/main/java/org/wso2/carbon/identity/mgt/endpoint/util/client/BrandingPreferenceRetrievalClient.java index 33e3e4fc44e..15d853dd779 100644 --- a/components/identity-mgt/org.wso2.carbon.identity.mgt.endpoint.util/src/main/java/org/wso2/carbon/identity/mgt/endpoint/util/client/BrandingPreferenceRetrievalClient.java +++ b/components/identity-mgt/org.wso2.carbon.identity.mgt.endpoint.util/src/main/java/org/wso2/carbon/identity/mgt/endpoint/util/client/BrandingPreferenceRetrievalClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2021-2024, WSO2 LLC. (http://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -55,6 +55,8 @@ public class BrandingPreferenceRetrievalClient { private static final String RESOURCE_NAME_URL_SEARCH_PARAM = "name"; private static final String RESOURCE_LOCALE_URL_SEARCH_PARAM = "locale"; private static final String RESOURCE_SCREEN_URL_SEARCH_PARAM = "screen"; + private static final String RESTRICT_TO_PUBLISHED_URL_SEARCH_PARAM = "restrictToPublished"; + private static final String TRUE = "true"; /** * Check for branding preference in the given tenant. @@ -87,6 +89,8 @@ public JSONObject getPreference(String tenant, String type, String name, String if (StringUtils.isNotBlank(locale)) { uriBuilder.addParameter(RESOURCE_LOCALE_URL_SEARCH_PARAM, locale); } + + uriBuilder.addParameter(RESTRICT_TO_PUBLISHED_URL_SEARCH_PARAM, TRUE); uri = uriBuilder.build().toString(); if (log.isDebugEnabled()) {