1 package org.springframework.security.oauth2.provider.code;
2
3 import java.util.concurrent.ConcurrentHashMap;
4
5 import org.springframework.security.oauth2.provider.OAuth2Authentication;
6
7
8
9
10
11
12
13 public class InMemoryAuthorizationCodeServices extends RandomValueAuthorizationCodeServices {
14
15 protected final ConcurrentHashMap<String, OAuth2Authentication> authorizationCodeStore = new ConcurrentHashMap<String, OAuth2Authentication>();
16
17 @Override
18 protected void store(String code, OAuth2Authentication authentication) {
19 this.authorizationCodeStore.put(code, authentication);
20 }
21
22 @Override
23 public OAuth2Authentication remove(String code) {
24 OAuth2Authentication auth = this.authorizationCodeStore.remove(code);
25 return auth;
26 }
27
28 }