new Object[] {TemplateEngine.threadIndex()});
}
return null;
}
final Authentication authentication =
SecurityContextHolder.getContext().getAuthentication();
if (authentication == null || authentication.getPrincipal() == null) {
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] No authentication object found in context.",
new Object[] {TemplateEngine.threadIndex()});
}
return null;
}
if (logger.isTraceEnabled()) {
logger.trace("[THYMELEAF][{}] Authentication object of class {} found in context for user \"{}\".",
new Object[] {TemplateEngine.threadIndex(), authentication.getClass().getName()}, authentication.getName());
}
return authentication;
}