diff --git a/kogito-build/kogito-dependencies-bom/pom.xml b/kogito-build/kogito-dependencies-bom/pom.xml
index 457b11f98ae..82b1ec4ead3 100644
--- a/kogito-build/kogito-dependencies-bom/pom.xml
+++ b/kogito-build/kogito-dependencies-bom/pom.xml
@@ -58,7 +58,7 @@
1.9.4
9.8.3
42.5.1
- 4.0.3.Final
+ 4.0.4.Final
2.2.1
4.2.0
diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-runtime/src/main/java/org/kie/kogito/serverless/workflow/io/HttpContentLoader.java b/kogito-serverless-workflow/kogito-serverless-workflow-runtime/src/main/java/org/kie/kogito/serverless/workflow/io/HttpContentLoader.java
index 53b29c5a5bc..9a4d413eb5d 100644
--- a/kogito-serverless-workflow/kogito-serverless-workflow-runtime/src/main/java/org/kie/kogito/serverless/workflow/io/HttpContentLoader.java
+++ b/kogito-serverless-workflow/kogito-serverless-workflow-runtime/src/main/java/org/kie/kogito/serverless/workflow/io/HttpContentLoader.java
@@ -20,6 +20,7 @@
import java.net.HttpURLConnection;
import java.net.URI;
import java.util.Base64;
+import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -38,6 +39,7 @@
import io.serverlessworkflow.api.auth.BasicAuthDefinition;
import io.serverlessworkflow.api.auth.BearerAuthDefinition;
import io.serverlessworkflow.api.auth.OauthDefinition;
+import io.serverlessworkflow.api.workflow.Auth;
class HttpContentLoader extends FallbackContentLoader {
@@ -58,9 +60,9 @@ protected byte[] loadURI(URI u) {
HttpURLConnection conn = (HttpURLConnection) u.toURL().openConnection();
// some http servers required specific accept header (*/* is specified for those we do not care about accept)
conn.setRequestProperty("Accept", "application/json,application/yaml,application/yml,application/text,text/*,*/*");
- workflow.map(Workflow::getAuth)
+ workflow.map(Workflow::getAuth).map(Auth::getAuthDefs).stream().flatMap(Collection::stream)
.filter(auth -> Objects.equals(auth.getName(), authRef))
- .ifPresent(auth -> addAuth(conn, auth));
+ .forEach(auth -> addAuth(conn, auth));
int code = conn.getResponseCode();
if (code == HttpURLConnection.HTTP_OK) {
try (InputStream is = conn.getInputStream()) {