View Javadoc
1   package org.springframework.security.oauth2.provider.implicit;
2   
3   import java.util.concurrent.ConcurrentHashMap;
4   
5   import org.springframework.security.oauth2.provider.OAuth2Request;
6   import org.springframework.security.oauth2.provider.TokenRequest;
7   
8   /**
9    * In-memory implementation of the ImplicitGrantService.
10   * 
11   * @author Amanda Anganes
12   *
13   */
14  @SuppressWarnings("deprecation")
15  public class InMemoryImplicitGrantService implements ImplicitGrantService {
16  
17  	protected final ConcurrentHashMap<TokenRequest, OAuth2Request> requestStore = new ConcurrentHashMap<TokenRequest, OAuth2Request>();
18  	
19  	public void store(OAuth2Request originalRequest, TokenRequest tokenRequest) {
20  		this.requestStore.put(tokenRequest, originalRequest);
21  	}
22  
23  	public OAuth2Request remove(TokenRequest tokenRequest) {
24  		OAuth2Request request = this.requestStore.remove(tokenRequest);
25  		return request;
26  	}
27  
28  }