diff --git a/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute b/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute index bab9347d..a10cb86a 100644 --- a/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute +++ b/deployment/src/main/resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute @@ -198,11 +198,22 @@ public class CompositeAuthenticationProvider extends AbstractCompositeAuthentica {#for auth in oauthMethods.orEmpty} @javax.enterprise.context.Dependent {#if is-resteasy-reactive} - static class OidcClientRequestFilterDelegateImpl{auth_index} extends io.quarkus.oidc.client.reactive.filter.OidcClientRequestReactiveFilter implements io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate { - {#else} - static class OidcClientRequestFilterDelegateImpl{auth_index} extends io.quarkus.oidc.client.filter.OidcClientRequestFilter implements io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate { - {/if} + static class OidcClientRequestFilterDelegateImpl{auth_index} extends io.quarkus.oidc.client.reactive.filter.OidcClientRequestReactiveFilter implements io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate { + + private final String clientId = io.quarkiverse.openapi.generator.OpenApiGeneratorConfig.getSanitizedSecuritySchemeName("{auth.name}"); + + @Override + protected Optional clientId() { + return Optional.of(clientId); + } + @Override + public void filter(javax.ws.rs.client.ClientRequestContext requestContext) throws java.io.IOException { + filter((org.jboss.resteasy.reactive.client.spi.ResteasyReactiveClientRequestContext)requestContext); + } + } + {#else} + static class OidcClientRequestFilterDelegateImpl{auth_index} extends io.quarkus.oidc.client.filter.OidcClientRequestFilter implements io.quarkiverse.openapi.generator.providers.OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate { private final String clientId = io.quarkiverse.openapi.generator.OpenApiGeneratorConfig.getSanitizedSecuritySchemeName("{auth.name}"); @Override @@ -210,5 +221,6 @@ public class CompositeAuthenticationProvider extends AbstractCompositeAuthentica return Optional.of(clientId); } } + {/if} {/for} -} \ No newline at end of file +} diff --git a/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/OAuth2AuthenticationProvider.java b/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/OAuth2AuthenticationProvider.java index 95e198b5..01af7238 100644 --- a/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/OAuth2AuthenticationProvider.java +++ b/runtime/src/main/java/io/quarkiverse/openapi/generator/providers/OAuth2AuthenticationProvider.java @@ -57,7 +57,7 @@ private void validateConfig() { } } - public interface OidcClientRequestFilterDelegate { - void filter(T requestContext) throws IOException; + public interface OidcClientRequestFilterDelegate { + void filter(ClientRequestContext requestContext) throws IOException; } }