{"record":{"id":"175684c08c7a0ead","repo":"quarkusio/quarkus","slug":"use-the-oidcclientcommonconfigbuilder-credentials","errorCode":null,"errorMessage":"Use the 'OidcClientCommonConfigBuilder.CredentialsBuilder#build' method instead","messagePattern":"Use the 'OidcClientCommonConfigBuilder\\.CredentialsBuilder#build' method instead","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"extensions/oidc-common/runtime/src/main/java/io/quarkus/oidc/common/runtime/config/OidcClientCommonConfigBuilder.java","lineNumber":293,"sourceCode":"        }\n\n        /**\n         * @return Credentials\n         */\n        public Credentials build() {\n            return new CredentialsImpl(secret, clientSecret, jwt, forAllEndpoints);\n        }\n\n        private static <T> OidcClientCommonConfigBuilder<T> getConfigBuilderWithDefaults() {\n            final OidcClientCommonConfig clientCommonConfig = new SmallRyeConfigBuilder()\n                    .addDiscoveredConverters()\n                    .withMapping(OidcClientCommonConfig.class)\n                    .build()\n                    .getConfigMapping(OidcClientCommonConfig.class);\n            return new OidcClientCommonConfigBuilder<>(clientCommonConfig) {\n                @Override\n                protected T getBuilder() {\n                    throw new UnsupportedOperationException(\n                            \"Use the 'OidcClientCommonConfigBuilder.CredentialsBuilder#build' method instead\");\n                }\n            };\n        }\n    }\n\n    /**\n     * The {@link Secret} builder.\n     */\n    public static final class SecretBuilder<T> {\n\n        private record SecretImpl(Optional<String> value, Optional<Method> method, Provider provider) implements Secret {\n        }\n\n        private final CredentialsBuilder<T> builder;\n\n        private Optional<String> value;\n        private Optional<Method> method;","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/oidc-common/runtime/src/main/java/io/quarkus/oidc/common/runtime/config/OidcClientCommonConfigBuilder.java#L275-L311","documentation":"OidcClientCommonConfigBuilder.forClientCommonConfig returns an anonymous builder whose overridden getBuilder() always throws UnsupportedOperationException, deliberately blocking use of a builder method that is no longer valid in this context. It is an API-misuse guard: the CredentialsBuilder#build path must be used instead.","triggerScenarios":"Invoking getBuilder() (or the deprecated fluent path that relies on it) on the builder created by OidcClientCommonConfigBuilder.forClientCommonConfig instead of using CredentialsBuilder#build.","commonSituations":"Programmatic OIDC client configuration written against an older builder API, then upgraded; IDE auto-completion suggesting the old method; custom code extending OidcClientCommonConfigBuilder without overriding getBuilder.","solutions":["Use the OidcClientCommonConfigBuilder.CredentialsBuilder#build method to finish credential configuration","Migrate programmatic config code to the current builder API","If extending the builder, provide your own getBuilder implementation instead of relying on the shared forClientCommonConfig instance"],"exampleFix":"// before\nbuilder.credentials().getBuilder()...\n// after\nbuilder.credentials().build()","handlingStrategy":"type-guard","validationCode":"// use only the public supported API\nOidcClientCommonConfigBuilder<?, ?> b = OidcClientCommonConfigBuilder.forClientCommonConfig(config);\nb.credentials(cb -> cb.build());","typeGuard":"boolean isThrowingBuilder(OidcClientCommonConfigBuilder<?, ?> b) {\n    return b.getClass().isAnonymousClass(); // forClientCommonConfig returns a throwing getBuilder()\n}","tryCatchPattern":null,"preventionTips":["Call CredentialsBuilder#build, never getBuilder()","Track the Quarkus upgrade notes for OIDC config builder API changes","Avoid subclassing internal builders"],"tags":["quarkus","oidc","api-misuse","unsupported-operation"],"backgroundTag":"unsupported-api-call","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}