org.apache.shindig.auth
Class BasicSecurityToken

java.lang.Object
  extended by org.apache.shindig.auth.AbstractSecurityToken
      extended by org.apache.shindig.auth.BasicSecurityToken
All Implemented Interfaces:
SecurityToken

public class BasicSecurityToken
extends AbstractSecurityToken
implements SecurityToken

Primitive token implementation that uses strings as tokens.


Constructor Summary
BasicSecurityToken(String token, int maxAge, String activeUrl)
          Generates a token from an input string
BasicSecurityToken(String owner, String viewer, String app, String domain, String appUrl, String moduleId, String container, String activeUrl, Long expiresAt)
           
 
Method Summary
 String getActiveUrl()
           
 String getAppId()
          
 String getAppUrl()
          
 String getAuthenticationMode()
           
 String getContainer()
          
 String getDomain()
          
 Long getExpiresAt()
           
 long getModuleId()
          
 String getOwnerId()
          
 String getTrustedJson()
          
 String getUpdatedToken()
          
 String getViewerId()
          
 boolean isAnonymous()
          
 
Methods inherited from class org.apache.shindig.auth.AbstractSecurityToken
isExpired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.shindig.auth.SecurityToken
isExpired
 

Constructor Detail

BasicSecurityToken

public BasicSecurityToken(String token,
                          int maxAge,
                          String activeUrl)
                   throws BlobCrypterException
Generates a token from an input string

Parameters:
token - String form of token
maxAge - max age of the token (in seconds)
Throws:
BlobCrypterException - never

BasicSecurityToken

public BasicSecurityToken(String owner,
                          String viewer,
                          String app,
                          String domain,
                          String appUrl,
                          String moduleId,
                          String container,
                          String activeUrl,
                          Long expiresAt)
                   throws BlobCrypterException
Throws:
BlobCrypterException
Method Detail

getAppId

public String getAppId()

Specified by:
getAppId in interface SecurityToken
Returns:
the application id from the token, or null if there is none.

getDomain

public String getDomain()

Specified by:
getDomain in interface SecurityToken
Returns:
the domain from the token, or null if there is none.

getContainer

public String getContainer()

Specified by:
getContainer in interface SecurityToken
Returns:
The container.

getOwnerId

public String getOwnerId()

Specified by:
getOwnerId in interface SecurityToken
Returns:
the owner from the token, or null if there is none.

getViewerId

public String getViewerId()

Specified by:
getViewerId in interface SecurityToken
Returns:
the viewer from the token, or null if there is none.

getAppUrl

public String getAppUrl()

Specified by:
getAppUrl in interface SecurityToken
Returns:
the URL of the application

getModuleId

public long getModuleId()

Specified by:
getModuleId in interface SecurityToken
Returns:
the module ID of the application

getExpiresAt

public Long getExpiresAt()
Specified by:
getExpiresAt in interface SecurityToken
Returns:
the timestamp that this token expires or null if unknown or indeterminate

getUpdatedToken

public String getUpdatedToken()

Specified by:
getUpdatedToken in interface SecurityToken
Returns:
an updated version of the token to return to the gadget, or null if there is no need to update the token.

getAuthenticationMode

public String getAuthenticationMode()
Specified by:
getAuthenticationMode in interface SecurityToken
Returns:
the authentication mechanism used to generate this security token
See Also:
AuthenticationMode

getTrustedJson

public String getTrustedJson()

Specified by:
getTrustedJson in interface SecurityToken
Returns:
a string formatted JSON object from the container, or null if there is no JSON from the container.

isAnonymous

public boolean isAnonymous()

Specified by:
isAnonymous in interface SecurityToken
Returns:
true if the token is for an anonymous viewer/owner

getActiveUrl

public String getActiveUrl()
Specified by:
getActiveUrl in interface SecurityToken
Overrides:
getActiveUrl in class AbstractSecurityToken
Returns:
the URL being used by the current request The returned URL must contain at least protocol, host, and port. The returned URL may contain path or query parameters.


Copyright © 2007-2012. All Rights Reserved.