{"record":{"id":"96a4cfc80c270c51","repo":"quarkusio/quarkus","slug":"no-anonymousidentityprovider-registered-an-instan","errorCode":null,"errorMessage":"No AnonymousIdentityProvider registered. An instance of AnonymousIdentityProvider must be provided to allow the Anonymous identity to be created.","messagePattern":"No AnonymousIdentityProvider registered\\. An instance of AnonymousIdentityProvider must be provided to allow the Anonymous identity to be created\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/security/runtime/src/main/java/io/quarkus/security/runtime/QuarkusIdentityProviderManagerImpl.java","lineNumber":242,"sourceCode":"            return this;\n        }\n\n        /**\n         * @param blockingExecutor The executor to use for blocking tasks\n         * @return this builder\n         */\n        public Builder setBlockingExecutor(Executor blockingExecutor) {\n            this.blockingExecutor = createBlockingExecutor(() -> blockingExecutor);\n            return this;\n        }\n\n        /**\n         * @return a new {@link QuarkusIdentityProviderManagerImpl}\n         */\n        public QuarkusIdentityProviderManagerImpl build() {\n            built = true;\n            if (!providers.containsKey(AnonymousAuthenticationRequest.class)) {\n                throw new IllegalStateException(\n                        \"No AnonymousIdentityProvider registered. An instance of AnonymousIdentityProvider must be provided to allow the Anonymous identity to be created.\");\n            }\n            for (List<IdentityProvider<?>> providers : providers.values()) {\n                providers.sort(new Comparator<IdentityProvider<? extends AuthenticationRequest>>() {\n                    @Override\n                    public int compare(IdentityProvider o1, IdentityProvider o2) {\n                        return Integer.compare(o2.priority(), o1.priority());\n                    }\n                });\n            }\n            if (blockingExecutor == null) {\n                throw new IllegalStateException(\"no blocking executor specified\");\n            }\n            augmentors.sort(new Comparator<SecurityIdentityAugmentor>() {\n                @Override\n                public int compare(SecurityIdentityAugmentor o1, SecurityIdentityAugmentor o2) {\n                    return Integer.compare(o2.priority(), o1.priority());\n                }","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/security/runtime/src/main/java/io/quarkus/security/runtime/QuarkusIdentityProviderManagerImpl.java#L224-L260","documentation":"Quarkus requires an AnonymousIdentityProvider so unauthenticated requests get an anonymous SecurityIdentity. The Builder refuses to construct the manager if no provider handles AnonymousAuthenticationRequest, since downstream code assumes an anonymous identity is always obtainable.","triggerScenarios":"Constructing QuarkusIdentityProviderManagerImpl manually in tests or custom code without adding an AnonymousIdentityProvider; replacing the default security build with custom wiring that omits the anonymous provider.","commonSituations":"Unit tests that build the manager with only their own providers; custom SecurityIdentityProvider setup in extensions; removing quarkus-security default configuration accidentally.","solutions":["Add an AnonymousIdentityProvider to the builder: builder.addProvider(new AnonymousIdentityProvider()) before build().","In production apps rely on the standard Quarkus wiring, which registers it automatically — check for custom build steps that replaced the SecurityIdentityProviderProducer.","In tests, mirror the production builder configuration."],"exampleFix":"// before\nvar manager = new Builder()\n    .addProvider(new MyAuthProvider())\n    .build();\n// after\nvar manager = new Builder()\n    .addProvider(new MyAuthProvider())\n    .addProvider(new AnonymousIdentityProvider())\n    .build();","handlingStrategy":"validation","validationCode":"// before build()\nif (!builderHasProvider(AnonymousAuthenticationRequest.class))\n    builder.addProvider(new AnonymousIdentityProvider());\nvar m = builder.build();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include AnonymousIdentityProvider in manual builds","Mirror default Quarkus security wiring in tests","Rely on CDI-produced manager in production"],"tags":["quarkus","security","authentication","anonymous-identity"],"backgroundTag":"missing-identity-provider","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"}