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

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

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

origin: org.apache.shindig/shindig-gadgets

 @Override
 public Map<String, String> toMap() {
  Map<String, String> map = super.toMap();
  map.put(REAL_CALLBACK_URL_KEY, getRealCallbackUrl());
  return map;
 }
}
origin: org.apache.shindig/shindig-gadgets

 @Override
 public Map<String, String> toMap() {
  final Map<String, String> map = super.toMap();
  final String g = this.getGadgetUri();
  if (g != null) {
   map.put(OAuth2CallbackStateToken.GADGET_URI, g);
  }

  final String sn = this.getServiceName();
  if (sn != null) {
   map.put(OAuth2CallbackStateToken.SERVICE_NAME, sn);
  }

  final String u = this.getUser();
  if (u != null) {
   map.put(OAuth2CallbackStateToken.USER, u);
  }

  final String sc = this.getScope();
  if (sc != null) {
   map.put(OAuth2CallbackStateToken.SCOPE, sc);
  }

  return map;
 }
}
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);
 }
}
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);
 }
}
org.apache.shindig.authAbstractSecurityTokentoMap

Javadoc

A Map representation of this SecurityToken. Implementors that handle additional keys not contained in Keys should override and supplement the functionality of this method.

Popular methods of AbstractSecurityToken

  • getExpiresAt
  • setActiveUrl
  • setAppId
  • setAppUrl
  • setContainer
  • setDomain
  • setExpiresAt
    Set the expiration time for this token.
  • setModuleId
  • setOwnerId
  • setTrustedJson
  • setViewerId
  • enforceNotExpired
  • setViewerId,
  • enforceNotExpired,
  • getContainer,
  • getMapKeys,
  • getMaxTokenTTL,
  • getTimeSource,
  • setExpires,
  • loadFromMap,
  • setTimeSource

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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