Update URL builder

Fixes: keycloak/keycloak-quickstarts#548

Signed-off-by: Hynek Mlnarik <hmlnarik@redhat.com>
This commit is contained in:
Hynek Mlnarik 2024-04-18 11:54:19 +02:00 committed by Hynek Mlnařík
parent eb2936f655
commit 9d1433d266

View file

@ -30,6 +30,7 @@ import org.keycloak.services.resources.RealmsResource;
import org.keycloak.services.resources.ThemeResource; import org.keycloak.services.resources.ThemeResource;
import org.keycloak.services.resources.admin.AdminRoot; import org.keycloak.services.resources.admin.AdminRoot;
import org.keycloak.utils.StringUtil;
import jakarta.ws.rs.core.UriBuilder; import jakarta.ws.rs.core.UriBuilder;
import java.net.URI; import java.net.URI;
@ -130,11 +131,14 @@ public class Urls {
} }
public static UriBuilder actionTokenBuilder(URI baseUri, String tokenString, String clientId, String tabId, String clientData) { public static UriBuilder actionTokenBuilder(URI baseUri, String tokenString, String clientId, String tabId, String clientData) {
return loginActionsBase(baseUri).path(LoginActionsService.class, "executeActionToken") UriBuilder res = loginActionsBase(baseUri).path(LoginActionsService.class, "executeActionToken")
.queryParam(Constants.KEY, tokenString) .queryParam(Constants.KEY, tokenString)
.queryParam(Constants.CLIENT_ID, clientId) .queryParam(Constants.CLIENT_ID, clientId)
.queryParam(Constants.TAB_ID, tabId) .queryParam(Constants.TAB_ID, tabId);
.queryParam(Constants.CLIENT_DATA, clientData); if (StringUtil.isNotBlank(clientData)) {
res = res.queryParam(Constants.CLIENT_DATA, clientData);
}
return res;
} }