1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.springframework.security.oauth2.config.annotation.configuration;
17
18 import org.springframework.context.annotation.Bean;
19 import org.springframework.context.annotation.Configuration;
20 import org.springframework.context.annotation.Lazy;
21 import org.springframework.context.annotation.Scope;
22 import org.springframework.context.annotation.ScopedProxyMode;
23 import org.springframework.security.oauth2.config.annotation.builders.ClientDetailsServiceBuilder;
24 import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
25 import org.springframework.security.oauth2.provider.ClientDetailsService;
26
27
28
29
30
31 @Configuration
32 public class ClientDetailsServiceConfiguration {
33
34 @SuppressWarnings("rawtypes")
35 private ClientDetailsServiceConfigurertation/configurers/ClientDetailsServiceConfigurer.html#ClientDetailsServiceConfigurer">ClientDetailsServiceConfigurer configurer = new ClientDetailsServiceConfigurer(new ClientDetailsServiceBuilder());
36
37 @Bean
38 public ClientDetailsServiceConfigurer clientDetailsServiceConfigurer() {
39 return configurer;
40 }
41
42 @Bean
43 @Lazy
44 @Scope(proxyMode=ScopedProxyMode.INTERFACES)
45 public ClientDetailsService clientDetailsService() throws Exception {
46 return configurer.and().build();
47 }
48
49 }