Tabnine Logo
AbstractSecurityToken.getContainer
Code IndexAdd Tabnine to your IDE (free)

How to use
getContainer
method
in
org.apache.shindig.auth.AbstractSecurityToken

Best Java code snippets using org.apache.shindig.auth.AbstractSecurityToken.getContainer (Showing top 3 results out of 315)

origin: org.apache.shindig/shindig-common

/**
 * Encrypt and sign the token.  The returned value is *not* web safe, it should be URL
 * encoded before being used as a form parameter.
 */
public String encodeToken(SecurityToken token) throws SecurityTokenException {
 if (!token.getAuthenticationMode().equals(
     AuthenticationMode.SECURITY_TOKEN_URL_PARAMETER.name())) {
  throw new SecurityTokenException("Can only encode BlobCrypterSecurityTokens");
 }
 // Test code sends in real AbstractTokens, they have modified time sources in them so
 // that we can test token expiration, production tokens are proxied via the SecurityToken interface.
 AbstractSecurityToken aToken = token instanceof AbstractSecurityToken ?
   (AbstractSecurityToken)token : BlobCrypterSecurityToken.fromToken(token);
 BlobCrypter crypter = crypters.get(aToken.getContainer());
 if (crypter == null) {
  throw new SecurityTokenException("Unknown container " + aToken.getContainer());
 }
 try {
  Integer tokenTTL = this.tokenTTLs.get(aToken.getContainer());
  if (tokenTTL != null) {
   aToken.setExpires(tokenTTL);
  } else {
   aToken.setExpires();
  }
  return aToken.getContainer() + ':' + crypter.wrap(aToken.toMap());
 } catch (BlobCrypterException e) {
  throw new SecurityTokenException(e);
 }
}
origin: apache/shindig

/**
 * Encrypt and sign the token.  The returned value is *not* web safe, it should be URL
 * encoded before being used as a form parameter.
 */
public String encodeToken(SecurityToken token) throws SecurityTokenException {
 if (!token.getAuthenticationMode().equals(
     AuthenticationMode.SECURITY_TOKEN_URL_PARAMETER.name())) {
  throw new SecurityTokenException("Can only encode BlobCrypterSecurityTokens");
 }
 // Test code sends in real AbstractTokens, they have modified time sources in them so
 // that we can test token expiration, production tokens are proxied via the SecurityToken interface.
 AbstractSecurityToken aToken = token instanceof AbstractSecurityToken ?
   (AbstractSecurityToken)token : BlobCrypterSecurityToken.fromToken(token);
 BlobCrypter crypter = crypters.get(aToken.getContainer());
 if (crypter == null) {
  throw new SecurityTokenException("Unknown container " + aToken.getContainer());
 }
 try {
  Integer tokenTTL = this.tokenTTLs.get(aToken.getContainer());
  if (tokenTTL != null) {
   aToken.setExpires(tokenTTL);
  } else {
   aToken.setExpires();
  }
  return aToken.getContainer() + ':' + crypter.wrap(aToken.toMap());
 } catch (BlobCrypterException e) {
  throw new SecurityTokenException(e);
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

/**
 * Encrypt and sign the token.  The returned value is *not* web safe, it should be URL
 * encoded before being used as a form parameter.
 */
public String encodeToken(SecurityToken token) throws SecurityTokenException {
 if (!token.getAuthenticationMode().equals(
     AuthenticationMode.SECURITY_TOKEN_URL_PARAMETER.name())) {
  throw new SecurityTokenException("Can only encode BlobCrypterSecurityTokens");
 }
 // Test code sends in real AbstractTokens, they have modified time sources in them so
 // that we can test token expiration, production tokens are proxied via the SecurityToken interface.
 AbstractSecurityToken aToken = token instanceof AbstractSecurityToken ?
   (AbstractSecurityToken)token : BlobCrypterSecurityToken.fromToken(token);
 BlobCrypter crypter = crypters.get(aToken.getContainer());
 if (crypter == null) {
  throw new SecurityTokenException("Unknown container " + aToken.getContainer());
 }
 try {
  Integer tokenTTL = this.tokenTTLs.get(aToken.getContainer());
  if (tokenTTL != null) {
   aToken.setExpires(tokenTTL);
  } else {
   aToken.setExpires();
  }
  return aToken.getContainer() + ':' + crypter.wrap(aToken.toMap());
 } catch (BlobCrypterException e) {
  throw new SecurityTokenException(e);
 }
}
org.apache.shindig.authAbstractSecurityTokengetContainer

Popular methods of AbstractSecurityToken

  • getExpiresAt
  • setActiveUrl
  • setAppId
  • setAppUrl
  • setContainer
  • setDomain
  • setExpiresAt
    Set the expiration time for this token.
  • setModuleId
  • setOwnerId
  • setTrustedJson
  • setViewerId
  • toMap
    A Map representation of this SecurityToken. Implementors that handle additional keys not contained i
  • setViewerId,
  • toMap,
  • enforceNotExpired,
  • getMapKeys,
  • getMaxTokenTTL,
  • getTimeSource,
  • setExpires,
  • loadFromMap,
  • setTimeSource

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • scheduleAtFixedRate (Timer)
  • runOnUiThread (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • JFileChooser (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now