Custom ClientDetailsService not picked up by auto-configuration
In OAuth2AuthorizationServerConfiguration it is auto-wiring BaseClientDetails but not search for ClientDetailsService in context, so it check for ClientDetailsService first and if its there should be used instead of creating in-memory one.
Rather than creating an issue with what you think the code is doing, could you please explain what you're trying to do and how the current auto-configuration does not fit? A sample project would be ideal.
OK, I faced an issue when I tried to use JdbcClientDetailsService that I was creating ClientDetailsService bean with @Bean in main Spring boot configuration class, but I found that the Auto configuration not using my ClientDetailsService bean and instead it is creating in-memory with properties from application.properties and if it is not there it is generating client and use it.
what am thinking about that the Auto configuration have to search for ClientDetailsService in context if it is there have to use it, and if there is no ClientDetailsService it is OK to create in-memory one.
The behaviour is working as advertized. I'd assume that you should define a AuthorizationServerConfigurer bean instead.
What do you think @dsyer ?
sure I can make my own AuthorizationServerConfigurer and this way am using to work around it, but if we checked Spring-security project for example, if you create a UserDetailsService in context the Auto-configuration is using it, so I was expecting the same behavior.
Yeah, works as designed, but maybe some room for improvement in the design. (Autowiring UserDetailsService is a recent thing in spring security, by the way.)
Boot's own OAuth support has been removed in 2.0 in favour of the OAuth support that's coming in Spring Security 5.x