Tabnine Logo
org.apache.shindig.auth
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.shindig.auth

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

origin: org.gatein.shindig/shindig-common

 public String encodeToken(SecurityToken token) throws SecurityTokenException {
  if (! (token instanceof BlobCrypterSecurityToken)) {
   throw new SecurityTokenException("Can only encode BlogCrypterSecurityTokens");
  }

  BlobCrypterSecurityToken t = (BlobCrypterSecurityToken)token;

  try {
   return t.encrypt();
  } catch (BlobCrypterException e) {
   throw new SecurityTokenException(e);
  }
 }
}
origin: org.apache.shindig/shindig-common

public AnonymousSecurityToken(String container, Long moduleId, String appUrl) {
 setContainer(container).setModuleId(moduleId).setAppUrl(appUrl)
  .setOwnerId(ANONYMOUS_ID)
  .setViewerId(ANONYMOUS_ID)
  .setDomain("*")
  .setTrustedJson("");
}
origin: org.apache.shindig/shindig-common

 public static BlobCrypterSecurityToken fromToken(SecurityToken token) {
  BlobCrypterSecurityToken interpretedToken = new BlobCrypterSecurityToken(token.getContainer(),
    token.getDomain(), token.getActiveUrl(), null);
  interpretedToken
    .setAppId(token.getAppId())
    .setAppUrl(token.getAppUrl())
    .setExpiresAt(token.getExpiresAt())
    .setModuleId(token.getModuleId())
    .setOwnerId(token.getOwnerId())
    .setTrustedJson(token.getTrustedJson())
    .setViewerId(token.getViewerId());

  return interpretedToken;
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

public SecurityToken getSecurityTokenFromRequest(HttpServletRequest request)
  throws InvalidAuthenticationException {
 Map<String, String> parameters = getMappedParameters(request);
 try {
  if (parameters.get(SecurityTokenCodec.SECURITY_TOKEN_NAME) == null) {
   return null;
  }
  return securityTokenCodec.createToken(parameters);
 } catch (SecurityTokenException e) {
  throw new InvalidAuthenticationException("Malformed security token " +
    parameters.get(SecurityTokenCodec.SECURITY_TOKEN_NAME), e);
 }
}
origin: com.lmco.shindig/shindig-common

 public String encodeToken(SecurityToken token) throws SecurityTokenException {
  if (token == null) {
   return null;
  }
  return codec.encodeToken(token);
 }
}
origin: org.apache.shindig/shindig-common

/**
 * Get the security token for this request.
 *
 * @return The security token
 */
public SecurityToken getSecurityToken() {
 return AuthInfoUtil.getSecurityTokenFromRequest(req);
}
origin: org.apache.shindig/shindig-common

/**
 * A helper to help load known supported keys from a provided map.
 *
 * @param map The map of values.
 * @see #getMapKeys()
 * @see #toMap()
 */
protected AbstractSecurityToken loadFromMap(Map<String, String> map) {
 for (Keys key : getMapKeys()) {
  key.loadFromMap(this, map);
 }
 return this;
}
origin: org.gatein.shindig/shindig-common

/**
 * Set the auth type for the request.
 *
 * @param authType The named auth type
 * @return This object
 */
AuthInfo setAuthType(String authType) {
 setRequestAttribute(req, Attribute.AUTH_TYPE, authType);
 return this;
}
origin: org.wso2.org.apache.shindig/shindig-common

/**
 * Set the security token for the request.
 *
 * @param req The request object
 * @param token The security token
 */
public static void setSecurityTokenForRequest(HttpServletRequest req, SecurityToken token) {
 setRequestAttribute(req, Attribute.SECURITY_TOKEN, token);
}
origin: org.apache.shindig/shindig-common

/**
 * Compute and set the expiration time for this token using the default TTL.
 *
 * @return This security token.
 * @see #setExpires(int)
 */
protected AbstractSecurityToken setExpires() {
 return setExpires(DEFAULT_MAX_TOKEN_TTL);
}
origin: org.wso2.org.apache.shindig/shindig-common

 public static BlobCrypterSecurityToken fromToken(SecurityToken token) {
  BlobCrypterSecurityToken interpretedToken = new BlobCrypterSecurityToken(token.getContainer(),
    token.getDomain(), token.getActiveUrl(), null);
  interpretedToken
    .setAppId(token.getAppId())
    .setAppUrl(token.getAppUrl())
    .setExpiresAt(token.getExpiresAt())
    .setModuleId(token.getModuleId())
    .setOwnerId(token.getOwnerId())
    .setTrustedJson(token.getTrustedJson())
    .setViewerId(token.getViewerId());

  return interpretedToken;
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

public AnonymousSecurityToken(String container, Long moduleId, String appUrl) {
 setContainer(container).setModuleId(moduleId).setAppUrl(appUrl)
  .setOwnerId(ANONYMOUS_ID)
  .setViewerId(ANONYMOUS_ID)
  .setDomain("*")
  .setTrustedJson("");
}
origin: com.lmco.shindig/shindig-common

 public String encodeToken(SecurityToken token) throws SecurityTokenException {
  if (! (token instanceof BlobCrypterSecurityToken)) {
   throw new SecurityTokenException("Can only encode BlogCrypterSecurityTokens");
  }

  BlobCrypterSecurityToken t = (BlobCrypterSecurityToken)token;

  try {
   return t.encrypt();
  } catch (BlobCrypterException e) {
   throw new SecurityTokenException(e);
  }
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

/**
 * A helper to help load known supported keys from a provided map.
 *
 * @param map The map of values.
 * @see #getMapKeys()
 * @see #toMap()
 */
protected AbstractSecurityToken loadFromMap(Map<String, String> map) {
 for (Keys key : getMapKeys()) {
  key.loadFromMap(this, map);
 }
 return this;
}
origin: com.lmco.shindig/shindig-common

/**
 * Set the security token for the request.
 *
 * @param token The security token
 * @return This object
 */
AuthInfo setSecurityToken(SecurityToken token) {
 setRequestAttribute(req, Attribute.SECURITY_TOKEN, token);
 return this;
}
origin: org.wso2.org.apache.shindig/shindig-common

/**
 * Set the auth type for the request.
 *
 * @param req The request object
 * @param authType The named auth type
 */
public static void setAuthTypeForRequest(HttpServletRequest req, String authType) {
 setRequestAttribute(req, Attribute.AUTH_TYPE, authType);
}
origin: apache/shindig

 public static BlobCrypterSecurityToken fromToken(SecurityToken token) {
  BlobCrypterSecurityToken interpretedToken = new BlobCrypterSecurityToken(token.getContainer(),
    token.getDomain(), token.getActiveUrl(), null);
  interpretedToken
    .setAppId(token.getAppId())
    .setAppUrl(token.getAppUrl())
    .setExpiresAt(token.getExpiresAt())
    .setModuleId(token.getModuleId())
    .setOwnerId(token.getOwnerId())
    .setTrustedJson(token.getTrustedJson())
    .setViewerId(token.getViewerId());

  return interpretedToken;
 }
}
origin: apache/shindig

public AnonymousSecurityToken(String container, Long moduleId, String appUrl) {
 setContainer(container).setModuleId(moduleId).setAppUrl(appUrl)
  .setOwnerId(ANONYMOUS_ID)
  .setViewerId(ANONYMOUS_ID)
  .setDomain("*")
  .setTrustedJson("");
}
origin: apache/shindig

/**
 * A helper to help load known supported keys from a provided map.
 *
 * @param map The map of values.
 * @see #getMapKeys()
 * @see #toMap()
 */
protected AbstractSecurityToken loadFromMap(Map<String, String> map) {
 for (Keys key : getMapKeys()) {
  key.loadFromMap(this, map);
 }
 return this;
}
origin: com.lmco.shindig/shindig-common

/**
 * Set the auth type for the request.
 *
 * @param authType The named auth type
 * @return This object
 */
AuthInfo setAuthType(String authType) {
 setRequestAttribute(req, Attribute.AUTH_TYPE, authType);
 return this;
}
org.apache.shindig.auth

Most used classes

  • SecurityToken
    An abstract representation of a signing token. Use in conjunction with @code SecurityTokenCodec.
  • AnonymousSecurityToken
    A special class of Token representing the anonymous viewer/owner
  • AuthenticationMode
    Enumeration of known authentication modes
  • SecurityTokenException
    Exceptions thrown by SecurityTokenCodec implementations.
  • BlobCrypterSecurityToken
    Authentication based on a provided BlobCrypter. Wire format is ":
  • BasicSecurityToken,
  • AuthInfoUtil$Attribute,
  • BasicSecurityTokenCodec,
  • BlobCrypterSecurityTokenCodec,
  • AbstractSecurityToken,
  • AuthenticationHandler$InvalidAuthenticationException,
  • AbstractSecurityToken$Keys,
  • AuthInfo$Attribute,
  • AuthInfo,
  • AuthenticationServletFilter,
  • OAuthUtil,
  • UrlParameterAuthenticationHandler,
  • AuthInfoUtil,
  • AuthenticationHandler
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