{"record":{"id":"2457efa9e78f1163","repo":"quarkusio/quarkus","slug":"unable-to-find-tokencustomizer-s","errorCode":null,"errorMessage":"Unable to find TokenCustomizer %s","messagePattern":"Unable to find TokenCustomizer (.+?)","errorType":"exception","errorClass":"OIDCException","httpStatus":null,"severity":"error","filePath":"extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/TenantFeatureFinder.java","lineNumber":36,"sourceCode":"public class TenantFeatureFinder {\n\n    private TenantFeatureFinder() {\n\n    }\n\n    public static TokenCustomizer find(OidcTenantConfig oidcConfig) {\n        if (oidcConfig == null) {\n            return null;\n        }\n        ArcContainer container = Arc.container();\n        if (container != null) {\n            String customizerName = oidcConfig.token().customizerName().orElse(null);\n            if (customizerName != null && !customizerName.isEmpty()) {\n                InstanceHandle<TokenCustomizer> tokenCustomizer = container.instance(customizerName);\n                if (tokenCustomizer.isAvailable()) {\n                    return tokenCustomizer.get();\n                } else {\n                    throw new OIDCException(\"Unable to find TokenCustomizer \" + customizerName);\n                }\n            } else if (oidcConfig.tenantId().isPresent()) {\n                List<TokenCustomizer> tokenCustomizers = find(oidcConfig, TokenCustomizer.class);\n                if (tokenCustomizers.isEmpty()) {\n                    return null;\n                }\n                if (tokenCustomizers.size() == 1) {\n                    return tokenCustomizers.get(0);\n                }\n                return new TokenCustomizer() {\n                    @Override\n                    public JsonObject customizeHeaders(JsonObject headers) {\n                        JsonObject result = headers;\n                        for (TokenCustomizer tokenCustomizer : tokenCustomizers) {\n                            var customizedHeaders = tokenCustomizer.customizeHeaders(result);\n                            if (customizedHeaders != null) {\n                                result = customizedHeaders;\n                            }","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/TenantFeatureFinder.java#L18-L54","documentation":"Quarkus OIDC looks up a named TokenCustomizer CDI bean when quarkus.oidc.<tenant>.token.customizer-name is set. This error is thrown when no bean with that name (or with that @Identifier) exists in the container, so token customization cannot proceed.","triggerScenarios":"quarkus.oidc.token.customizer-name (or tenant-specific equivalent) references a name for which container.instance(customizerName) returns no available TokenCustomizer bean at TenantFeatureFinder.find time.","commonSituations":"Typo in the customizer-name property; TokenCustomizer bean not annotated with @Identifier matching the configured name; bean not registered as a CDI bean (missing @ApplicationScoped); extension/module containing the customizer not included in the build.","solutions":["Annotate your TokenCustomizer bean with jakarta.enterprise.util.AnnotationLiteral-based @io.quarkus.oidc.TokenCustomizer qualifier or @Identifier(\"<name>\") matching exactly the configured customizer-name value.","Verify the property value has no typos and matches the bean identifier character-for-character.","Ensure the customizer class is a CDI bean (add @ApplicationScoped) and lives in a module included in the application build."],"exampleFix":"// before\n@ApplicationScoped\npublic class MyCustomizer implements TokenCustomizer { ... }\n# application.properties: quarkus.oidc.token.customizer-name=my-customizer\n\n// after\n@ApplicationScoped\n@Identifier(\"my-customizer\")\npublic class MyCustomizer implements TokenCustomizer { ... }","handlingStrategy":"validation","validationCode":"String name = config.token().customizerName().orElse(null);\nif (name != null && Arc.container().instance(name, TokenCustomizer.class) == null /* not available */) {\n    throw new IllegalStateException(\"No TokenCustomizer bean named \" + name);\n}","typeGuard":null,"tryCatchPattern":"try {\n    customizer = featureFinder.find(config);\n} catch (OIDCException e) {\n    LOG.errorf(\"TokenCustomizer '%s' not found: %s\", config.token().customizerName().orElse(\"\"), e.getMessage());\n    throw e;\n}","preventionTips":["Match @Identifier values to property values exactly.","Annotate customizer implementations with @ApplicationScoped so they register as CDI beans.","Add a startup test that resolves every configured customizer name."],"tags":["oidc","cdi","configuration"],"backgroundTag":"cdi-bean-not-found","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"}