{"record":{"id":"964a0585a37f8b56","repo":"quarkusio/quarkus","slug":"the-s-can-only-be-used-on-jakarta-rest-or-webso","errorCode":null,"errorMessage":"The '%s' can only be used on Jakarta REST or WebSockets Next endpoints","messagePattern":"The '(.+?)' can only be used on Jakarta REST or WebSockets Next endpoints","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/OidcBuildStep.java","lineNumber":552,"sourceCode":"    @Record(ExecutionTime.STATIC_INIT)\n    @BuildStep\n    FilterBuildItem registerResourceMetadataHandler(OidcBuildTimeConfig buildTimeConfig,\n            BeanContainerBuildItem beanContainerBuildItem, OidcRecorder recorder) {\n        if (!isRouteAllowed(buildTimeConfig, OidcRoute.RESOURCE_METADATA)) {\n            return null;\n        }\n        Handler<RoutingContext> handler = recorder.getResourceMetadataHandler(beanContainerBuildItem.getValue());\n        return new FilterBuildItem(handler, SecurityHandlerPriorities.AUTHORIZATION - 50);\n    }\n\n    private static boolean areEagerSecInterceptorsSupported(Capabilities capabilities,\n            VertxHttpBuildTimeConfig httpBuildTimeConfig) {\n        if (httpBuildTimeConfig.auth().proactive()) {\n            throw new RuntimeException(\"The '%s' annotation is only supported when proactive authentication is disabled\"\n                    .formatted(AUTHENTICATION_CONTEXT_NAME));\n        } else if (capabilities.isMissing(Capability.WEBSOCKETS_NEXT) && capabilities.isMissing(Capability.RESTEASY_REACTIVE)\n                && capabilities.isMissing(Capability.RESTEASY)) {\n            throw new RuntimeException(\"The '%s' can only be used on Jakarta REST or WebSockets Next endpoints\");\n        }\n        return true;\n    }\n\n    private static boolean isInjected(BeanRegistrationPhaseBuildItem beanRegistrationPhaseBuildItem, DotName requiredType,\n            DotName withoutQualifier) {\n        for (InjectionPointInfo injectionPoint : beanRegistrationPhaseBuildItem.getInjectionPoints()) {\n            if (requiredType.equals(injectionPoint.getRequiredType().name())\n                    && isApplicationPackage(injectionPoint.getTargetInfo())\n                    && (withoutQualifier == null || injectionPoint.getRequiredQualifier(withoutQualifier) == null)) {\n                LOG.debugf(\"%s injection point: %s\", requiredType.toString(), injectionPoint.getTargetInfo());\n                return true;\n            }\n        }\n        return false;\n    }\n\n    private static boolean isApplicationPackage(String injectionPointTargetInfo) {","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/OidcBuildStep.java#L534-L570","documentation":"Eager security interceptors like @AuthenticationContext can only be applied to Jakarta REST endpoints or WebSockets Next endpoints. If the application has neither the RESTEasy/RESTEasy-Reactive nor the WebSockets-Next capability, the build step throws RuntimeException since there is no supported target for the interceptor.","triggerScenarios":"Adding @AuthenticationContext in an application lacking resteasy-reactive, resteasy, and websockets-next dependencies (capabilities missing), detected via Capabilities in the build step.","commonSituations":"Quarkus REST (or legacy REST) not on the classpath, e.g. a gRPC/Vert.x-only app; annotation copied from another project without adding the REST dependency.","solutions":["Add the quarkus-rest (RESTEasy Reactive) dependency","Or add quarkus-websockets-next if using WebSockets Next endpoints","Remove the @AuthenticationContext annotation if the app has no supported endpoint type"],"exampleFix":"// before\n<!-- no REST dependency -->\n// after\n<dependency>\n  <groupId>io.quarkus</groupId>\n  <artifactId>quarkus-rest</artifactId>\n</dependency>","handlingStrategy":"validation","validationCode":"// Ensure one of these dependencies exists before using @AuthenticationContext:\n// io.quarkus:quarkus-rest, io.quarkus:quarkus-resteasy, or io.quarkus:quarkus-websockets-next","typeGuard":null,"tryCatchPattern":"try { Quarkus.run(args); } catch (RuntimeException e) { if (e.getMessage().contains(\"can only be used on Jakarta REST or WebSockets Next endpoints\")) { /* add missing dependency */ } }","preventionTips":["Add quarkus-rest or quarkus-websockets-next when adopting OIDC auth annotations","Do not copy annotations into apps without the matching extension","Check capabilities via the Quarkus build report"],"tags":["oidc","capability","annotation","build-time"],"backgroundTag":"missing-capability-dependency","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"}