- // List<GrantedAuthorityPrincipal> anonAuthorities = Collections
- // .singletonList(new GrantedAuthorityPrincipal(
- // KernelHeader.ROLE_ANONYMOUS));
- // UserDetails anonUser = new User(KernelHeader.USERNAME_ANONYMOUS,
- // "", true, true, true, true, anonAuthorities);
- // AnonymousAuthenticationToken anonToken = new
- // AnonymousAuthenticationToken(
- // DEFAULT_SECURITY_KEY, anonUser, anonAuthorities);
- // Authentication authentication = authenticationManager
- // .authenticate(anonToken);
- // SecurityContextHolder.getContext()
- // .setAuthentication(authentication);
- // } catch (Exception e) {
- // throw new CmsException("Cannot authenticate", e);
+ // lc = new LoginContext(NodeConstants.LOGIN_CONTEXT_USER, subject);
+ // lc.login();
+ // return subject;
+ // } catch (LoginException e) {
+ // throw new CmsException("Cannot login as anonymous", e);