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
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • getSystemService (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Top Vim plugins
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