// BasicCrypter. 6 is the magic number that is private static final in
// BasicBlobCrypterSecurityToken
container = tokenParts[6];
}
SecurityTokenCodec codec = getCodec(container);
if(codec == null) {
//Shindig is really bad about making sure containers are encoded before they
//are placed on URLs. It basically makes the assumption that container ids do
//not need to be encoded and just sticks them on the URLs. This is the case when
//it makes the request to the /rpc endpoint so just to be sure lets encode the container
//and try to look up the token type
try {
String encodedContainer = URLEncoder.encode(container, "UTF-8");
codec = getCodec(encodedContainer);
if(codec!= null) {
//Since the container was not properly encoded make sure it is correct in the token parameters
putContainerInTokenParams(tokenParameters, encodedContainer);
} else {
throw new RuntimeException("Could not find security token codec for container " + container);
}
} catch (UnsupportedEncodingException e) {
log.logp(Level.WARNING, CLASS, method, "Error while encoding container.");
}
}
return codec.createToken(tokenParameters);
}