public String getUsername(String b64String) throws CodecException{
String decoded = Base64Converter.decodeToString(b64String);
int index = decoded.indexOf(":");
if (index < 0) {
throw new CodecException("can't find ':' character in decoded credentials for :" + decoded);
}
return decoded.substring(0, index);
}