org.springframework.security.oauth.consumer.token
Class HttpSessionBasedTokenServices

java.lang.Object
  extended by org.springframework.security.oauth.consumer.token.HttpSessionBasedTokenServices
All Implemented Interfaces:
OAuthConsumerTokenServices

public class HttpSessionBasedTokenServices
extends Object
implements OAuthConsumerTokenServices

Stores the tokens in an HTTP session.

Author:
Ryan Heaton

Field Summary
static String KEY_PREFIX
           
 
Constructor Summary
HttpSessionBasedTokenServices()
           
 
Method Summary
protected  HttpSession getSession()
           
 OAuthConsumerToken getToken(String resourceId)
          Get the token for the specified protected resource.
 void removeToken(String resourceId)
          Removes the token for the specified resource.
 void storeToken(String resourceId, OAuthConsumerToken token)
          Store a token for a specified resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_PREFIX

public static final String KEY_PREFIX
See Also:
Constant Field Values
Constructor Detail

HttpSessionBasedTokenServices

public HttpSessionBasedTokenServices()
Method Detail

getToken

public OAuthConsumerToken getToken(String resourceId)
                            throws org.springframework.security.core.AuthenticationException
Description copied from interface: OAuthConsumerTokenServices
Get the token for the specified protected resource.

Specified by:
getToken in interface OAuthConsumerTokenServices
Parameters:
resourceId - The id of the protected resource.
Returns:
The token, or null if none was found.
Throws:
org.springframework.security.core.AuthenticationException

storeToken

public void storeToken(String resourceId,
                       OAuthConsumerToken token)
Description copied from interface: OAuthConsumerTokenServices
Store a token for a specified resource. If the token is not an access token, the token services may not have to store it and instead rely on the implementation of the remember-me services.

Specified by:
storeToken in interface OAuthConsumerTokenServices
Parameters:
resourceId - The id of the protected resource.
token - The token to store.

removeToken

public void removeToken(String resourceId)
Description copied from interface: OAuthConsumerTokenServices
Removes the token for the specified resource.

Specified by:
removeToken in interface OAuthConsumerTokenServices
Parameters:
resourceId - The id of the resource.

getSession

protected HttpSession getSession()


Copyright © 2012. All Rights Reserved.