quarkusio/quarkus · error · ConfigurationException

The '%s' annotation has been used to configure the '%s' OIDC

Error message

The '%s' annotation has been used to configure the '%s' OIDC client for the '%s' GraphQL client. However, the 'quarkus.oidc-client-graphql."%s".client-name' configuration property sets the OIDC client to '%s'. Please choose one way to configure the OIDC client name.

What it means

The OIDC-GraphQL integration build step detects how each GraphQL client's OIDC client is chosen: via the @OIDCClient annotation or via quarkus.oidc-client-graphql."key".client-name config. This ConfigurationException is thrown at build time when both are used and disagree, so the target OIDC client is ambiguous.

Source

Thrown at extensions/oidc-client-graphql/deployment/src/main/java/io/quarkus/oidc/client/graphql/OidcGraphQLClientIntegrationProcessor.java:66

    private static final String TOKEN_PROVIDER_CLASS = AbstractGraphQLTokenProvider.class.getName();

    @BuildStep
    void feature(BuildProducer<FeatureBuildItem> featureProducer) {
        featureProducer.produce(new FeatureBuildItem(Feature.OIDC_CLIENT_GRAPHQL_CLIENT_INTEGRATION));
    }

    @BuildStep
    GraphQLTokenProducerInfo collectGraphQLTokenProducerInfo(OidcClientGraphQLConfig config,
            CombinedIndexBuildItem combinedIndex) {
        var configKeysToOidcClientsFromIndex = getConfigKeysToOidcClientsFromIndex(combinedIndex.getIndex(), false);

        // named OIDC clients
        var configKeysToOidcClients = new HashMap<>(configKeysToOidcClientsFromIndex);
        config.additionalOidcClients().forEach((graphQlClient, oidcClient) -> {
            var previousOidcClient = configKeysToOidcClients.put(graphQlClient, oidcClient.clientName());
            if (previousOidcClient != null && !previousOidcClient.equals(oidcClient.clientName())) {
                throw new ConfigurationException("""
                        The '%s' annotation has been used to configure the '%s' OIDC client for the '%s' GraphQL client.
                        However, the 'quarkus.oidc-client-graphql."%s".client-name' configuration property
                        sets the OIDC client to '%s'. Please choose one way to configure the OIDC client name.
                        """.formatted(OIDC_CLIENT_FILTER, previousOidcClient, graphQlClient, graphQlClient,
                        oidcClient.clientName()));
            }
        });

        Map<String, String> oidcClientToTokenProducerBeanName = new HashMap<>();
        configKeysToOidcClients.values().forEach(oidcClient -> oidcClientToTokenProducerBeanName
                .putIfAbsent(oidcClient, generatedBeanClassName(oidcClient)));

        // default OIDC client used when the GraphQL client doesn't have explicitly assigned another client
        config.clientName().ifPresentOrElse(defaultOidcClientName -> oidcClientToTokenProducerBeanName
                .putIfAbsent(defaultOidcClientName, generatedBeanClassName(defaultOidcClientName)),
                () -> oidcClientToTokenProducerBeanName.put(DEFAULT_CLIENT_KEY, generatedBeanClassName(DEFAULT_CLIENT_KEY)));

        return new GraphQLTokenProducerInfo(oidcClientToTokenProducerBeanName, configKeysToOidcClientsFromIndex);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Remove the quarkus.oidc-client-graphql."<key>".client-name property and keep the @OIDCClient annotation
  2. Or remove the @OIDCClient annotation and configure only via the property
  3. Make both mechanisms name the same OIDC client
  4. Search application.properties/yaml for all quarkus.oidc-client-graphql entries for this key

Example fix

# before
@OIDCClient("clients")
quarkus.oidc-client-graphql."my-client".client-name=other

# after
@OIDCClient("clients")
# property removed
Defensive patterns

Strategy: validation

Validate before calling

String annClient = graphQLClient.getAnnotation(OIDCClient.class) != null ? graphQLClient.getAnnotation(OIDCClient.class).value() : null;
String cfgClient = config.getClientName(configKey);
if (annClient != null && cfgClient != null && !annClient.equals(cfgClient)) throw new IllegalStateException("OIDC client naming conflict for " + configKey);

Prevention

When it happens

Trigger: Annotating a GraphQL client with @OIDCClient("a") while application.properties sets quarkus.oidc-client-graphql."<key>".client-name=b for the same GraphQL client config key.

Common situations: Adding the annotation to code that already had config-based client naming (or vice versa) during refactoring; team members configuring the same client in two ways; copying examples that mix both styles.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/1f9cf9b37a2719da. Report an issue: GitHub.