com.dyuproject.oauth.manager
Class CookieBasedTokenManager

java.lang.Object
  extended by com.dyuproject.oauth.manager.CookieBasedTokenManager
All Implemented Interfaces:
TokenManager

public final class CookieBasedTokenManager
extends Object
implements TokenManager

CookieBasedTokenManager - stores the token in the cookie encrypted.

Author:
David Yu
Date created:
May 30, 2009

Constructor Summary
CookieBasedTokenManager()
           
CookieBasedTokenManager(String secretKey)
           
CookieBasedTokenManager(String secretKey, String cookiePath, String cookieDomain, int loginTimeout, int maxAge)
           
 
Method Summary
 StandardJSON getJSON()
           
 Token getToken(String consumerKey, HttpServletRequest request)
          Gets the token.
protected  void init()
           
 void init(Properties properties)
          Initialize this manager based from the given properties.
 boolean invalidate(String consumerKey, HttpServletRequest request, HttpServletResponse response)
          Invalidates the token.
 boolean saveToken(Token token, HttpServletRequest request, HttpServletResponse response)
          Saves the token.
 void setCookieDomain(String cookieDomain)
           
 void setCookiePath(String cookiePath)
           
 void setLoginTimeout(int loginTimeout)
           
 void setMaxAge(int maxAge)
           
 void setSecretKey(String secretKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieBasedTokenManager

public CookieBasedTokenManager()

CookieBasedTokenManager

public CookieBasedTokenManager(String secretKey)

CookieBasedTokenManager

public CookieBasedTokenManager(String secretKey,
                               String cookiePath,
                               String cookieDomain,
                               int loginTimeout,
                               int maxAge)
Method Detail

getJSON

public StandardJSON getJSON()

init

public void init(Properties properties)
Description copied from interface: TokenManager
Initialize this manager based from the given properties.

Specified by:
init in interface TokenManager

setSecretKey

public void setSecretKey(String secretKey)

setCookiePath

public void setCookiePath(String cookiePath)

setCookieDomain

public void setCookieDomain(String cookieDomain)

setMaxAge

public void setMaxAge(int maxAge)

setLoginTimeout

public void setLoginTimeout(int loginTimeout)

init

protected void init()

getToken

public Token getToken(String consumerKey,
                      HttpServletRequest request)
               throws IOException
Description copied from interface: TokenManager
Gets the token.

Specified by:
getToken in interface TokenManager
Throws:
IOException

saveToken

public boolean saveToken(Token token,
                         HttpServletRequest request,
                         HttpServletResponse response)
                  throws IOException
Description copied from interface: TokenManager
Saves the token.

Specified by:
saveToken in interface TokenManager
Throws:
IOException

invalidate

public boolean invalidate(String consumerKey,
                          HttpServletRequest request,
                          HttpServletResponse response)
                   throws IOException
Description copied from interface: TokenManager
Invalidates the token.

Specified by:
invalidate in interface TokenManager
Throws:
IOException


Copyright © 2008-2013. All Rights Reserved.