final HttpServletResponse httpServletResponse = (HttpServletResponse) response;
final HttpServletRequest httpServletRequest = (HttpServletRequest) request;
final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
final UserMgmtService userMgmtService = beanManager.getReference(UserMgmtService.class);
final UserQueryService userQueryService = beanManager.getReference(UserQueryService.class);
try {
userMgmtService.tryLogInWithCookie(httpServletRequest, httpServletResponse);
final JSONObject currentUser = userQueryService.getCurrentUser(httpServletRequest);
if (null == currentUser) {
LOGGER.warn("The request has been forbidden");
httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);