{"record":{"id":"3f79fa9eb2c1a1b7","repo":"quarkusio/quarkus","slug":"multiple-interface-io-quarkus-oidc-javascriptreque","errorCode":null,"errorMessage":"Multiple interface io.quarkus.oidc.JavaScriptRequestChecker beans registered","messagePattern":"Multiple interface io\\.quarkus\\.oidc\\.JavaScriptRequestChecker beans registered","errorType":"console","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/DefaultTenantConfigResolver.java","lineNumber":110,"sourceCode":"                tenantResolverInstance);\n    }\n\n    @PostConstruct\n    public void verifyResolvers() {\n        if (tenantConfigResolver.isResolvable() && tenantConfigResolver.isAmbiguous()) {\n            throw new IllegalStateException(\"Multiple \" + TenantConfigResolver.class + \" beans registered\");\n        }\n        if (tokenStateManager.isAmbiguous()) {\n            throw new IllegalStateException(\"Multiple \" + TokenStateManager.class + \" beans registered\");\n        }\n        if (tokenIntrospectionCache.isAmbiguous()) {\n            throw new IllegalStateException(\"Multiple \" + TokenIntrospectionCache.class + \" beans registered\");\n        }\n        if (userInfoCache.isAmbiguous()) {\n            throw new IllegalStateException(\"Multiple \" + UserInfo.class + \" beans registered\");\n        }\n        if (javaScriptRequestChecker.isAmbiguous()) {\n            throw new IllegalStateException(\"Multiple \" + JavaScriptRequestChecker.class + \" beans registered\");\n        }\n\n    }\n\n    List<AuthenticationCompletionAction> authenticationCompletionActions() {\n        return authenticationCompletionActions;\n    }\n\n    Uni<OidcTenantConfig> resolveConfig(RoutingContext context) {\n        return getDynamicTenantConfig(context)\n                .flatMap(new Function<OidcTenantConfig, Uni<? extends OidcTenantConfig>>() {\n                    @Override\n                    public Uni<OidcTenantConfig> apply(OidcTenantConfig oidcTenantConfig) {\n                        if (oidcTenantConfig != null) {\n                            return Uni.createFrom().item(oidcTenantConfig);\n                        }\n                        final String tenantId = context.get(OidcUtils.TENANT_ID_ATTRIBUTE);\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/DefaultTenantConfigResolver.java#L92-L128","documentation":"verifyResolvers() throws when multiple JavaScriptRequestChecker beans are registered. This OIDC SPI decides whether an incoming request should be treated as a JavaScript/browser request for auth-code-flow purposes, so exactly one implementation must be resolvable.","triggerScenarios":"Two beans implementing io.quarkus.oidc.JavaScriptRequestChecker exist in the container, making javaScriptRequestChecker.isAmbiguous() true during DefaultTenantConfigResolver startup verification.","commonSituations":"Adding a custom checker for SPAs while another (e.g. from a shared internal library) is present; duplicate classes in different packages both annotated @ApplicationScoped.","solutions":["Keep a single JavaScriptRequestChecker implementation; delete or un-annotate the extra one.","Use @Alternative plus @Priority on the intended implementation.","Alternatively rely on quarkus.oidc authentication.js-request-checker-style config or set AuthenticationScheme headers instead of multiple checkers."],"exampleFix":"// before\n@ApplicationScoped class CheckerA implements JavaScriptRequestChecker { ... }\n@ApplicationScoped class CheckerB implements JavaScriptRequestChecker { ... }\n\n// after - only CheckerB active\n@ApplicationScoped @Alternative @Priority(1)\nclass CheckerB implements JavaScriptRequestChecker { ... }","handlingStrategy":"validation","validationCode":"long checkers = CDI.current().select(JavaScriptRequestChecker.class).stream().count();\nif (checkers > 1) {\n    throw new IllegalStateException(\"Register only one JavaScriptRequestChecker\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep exactly one SPA request checker; mark extras @Alternative","Use quarkus.oidc tenancy/auth config for browser detection when possible","Check internal libraries before introducing another checker"],"tags":["cdi","oidc","startup","spa"],"backgroundTag":"ambiguous-cdi-bean","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"}