{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/453","labels_url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/453/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/453/comments","events_url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/453/events","html_url":"https://github.com/spring-projects/spring-security-oauth/issues/453","id":66896860,"number":453,"title":"Injecting AuthenticationManager in AuthorizationServerConfiguration constructor","user":{"login":"qinfchen","id":8294715,"avatar_url":"https://avatars.githubusercontent.com/u/8294715?v=3","gravatar_id":"","url":"https://api.github.com/users/qinfchen","html_url":"https://github.com/qinfchen","followers_url":"https://api.github.com/users/qinfchen/followers","following_url":"https://api.github.com/users/qinfchen/following{/other_user}","gists_url":"https://api.github.com/users/qinfchen/gists{/gist_id}","starred_url":"https://api.github.com/users/qinfchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qinfchen/subscriptions","organizations_url":"https://api.github.com/users/qinfchen/orgs","repos_url":"https://api.github.com/users/qinfchen/repos","events_url":"https://api.github.com/users/qinfchen/events{/privacy}","received_events_url":"https://api.github.com/users/qinfchen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-07T14:14:48Z","updated_at":"2015-04-17T11:09:26Z","closed_at":"2015-04-17T11:09:26Z","body":"Hi,\r\n\r\nI have been trying to inject AuthenticationManager in the constructor of AuthorizationServerConfiguration, but have no luck of getting it to work. The reason I want to use constructor injection is that I want to make sure authenticationManager is instantiated when AuthorizationServerConfiguration's constructor is called and, hence, no need to check authenticationManager when it is used later. \r\n\r\nIt loos like AuthorizationServerConfiguration's constructor gets called first before authenticationManagerBean from the debugger. Here is the error i am getting.\r\n\r\n```\r\nNo default constructor found; nested exception is java.lang.NoSuchMethodException: com.palantir.multipass.server.OAuth2ServerConfiguration$AuthorizationServerConfiguration$$EnhancerBySpringCGLIB$$20eef8d4.<init>()\r\n```\r\n\r\nHere is my current code\r\n```\r\n@Configuration\r\n@EnableWebMvcSecurity\r\npublic class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {\r\n    @Override\r\n    @Bean\r\n    public AuthenticationManager authenticationManagerBean() throws Exception {\r\n        return super.authenticationManagerBean();\r\n    }\r\n}\r\n```\r\n```\r\n    @Configuration\r\n    @EnableAuthorizationServer\r\n    public static class AuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter {\r\n        @Autowired\r\n        private AuthenticationManager authenticationManager;\r\n}\r\n```\r\nand I want to do something like below\r\n```\r\n    @Configuration\r\n    @EnableAuthorizationServer\r\n    public static class AuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter {\r\n        \r\n        private final AuthenticationManager authenticationManager;\r\n\r\n        @Autowired\r\n        AuthorizationServerConfiguration(AuthenticationManager authenticationManager) {\r\n            this.authenticationManager = authenticationManager;\r\n        }\r\n}\r\n```\r\n\r\nAny idea if this is possible? Sorry for the long post"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/comments/93966322","html_url":"https://github.com/spring-projects/spring-security-oauth/issues/453#issuecomment-93966322","issue_url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/453","id":93966322,"user":{"login":"dsyer","id":124075,"avatar_url":"https://avatars.githubusercontent.com/u/124075?v=3","gravatar_id":"","url":"https://api.github.com/users/dsyer","html_url":"https://github.com/dsyer","followers_url":"https://api.github.com/users/dsyer/followers","following_url":"https://api.github.com/users/dsyer/following{/other_user}","gists_url":"https://api.github.com/users/dsyer/gists{/gist_id}","starred_url":"https://api.github.com/users/dsyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsyer/subscriptions","organizations_url":"https://api.github.com/users/dsyer/orgs","repos_url":"https://api.github.com/users/dsyer/repos","events_url":"https://api.github.com/users/dsyer/events{/privacy}","received_events_url":"https://api.github.com/users/dsyer/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T11:09:26Z","updated_at":"2015-04-17T11:09:26Z","body":"Constructor autowiring is not currently supported (apparently) by Spring. Since it's not an Oauth2 concern, I refer you to the Spring JIRA tracker."}}