1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.springframework.security.oauth2.config.annotation.builders;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import org.springframework.security.oauth2.provider.ClientDetails;
22 import org.springframework.security.oauth2.provider.ClientDetailsService;
23 import org.springframework.security.oauth2.provider.client.InMemoryClientDetailsService;
24
25
26
27
28
29 public class InMemoryClientDetailsServiceBuilder extends
30 ClientDetailsServiceBuilder<InMemoryClientDetailsServiceBuilder> {
31
32 private Map<String, ClientDetails> clientDetails = new HashMap<String, ClientDetails>();
33
34 @Override
35 protected void addClient(String clientId, ClientDetails value) {
36 clientDetails.put(clientId, value);
37 }
38
39 @Override
40 protected ClientDetailsService performBuild() {
41 InMemoryClientDetailsService clientDetailsService = new InMemoryClientDetailsService();
42 clientDetailsService.setClientDetailsStore(clientDetails);
43 return clientDetailsService;
44 }
45
46 }