diff --git a/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/BearerAuthenticationProvider.java b/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/BearerAuthenticationProvider.java index 462446af..d2145482 100644 --- a/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/BearerAuthenticationProvider.java +++ b/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/BearerAuthenticationProvider.java @@ -34,8 +34,10 @@ public void filter(ClientRequestContext requestContext) throws IOException { } else { bearerToken = getBearerToken(); } - requestContext.getHeaders().add(HttpHeaders.AUTHORIZATION, - AuthUtils.authTokenOrBearer(this.scheme, bearerToken)); + if (!bearerToken.isBlank()) { + requestContext.getHeaders().add(HttpHeaders.AUTHORIZATION, + AuthUtils.authTokenOrBearer(this.scheme, bearerToken)); + } } private String getBearerToken() {