@Override
 public Authentication getAnonymousAuthentication() {
   log.debug("Starting to generate Anonymous authentication");
   UserGroupService userGroupService = ContextHelper.get().beanForType(UserGroupService.class);
   UserInfo userInfo = userGroupService.findOrCreateExternalAuthUser(UserInfo.ANONYMOUS, true);
   MutableUserInfo mutableUserInfo = InfoFactoryHolder.get().copyUser(userInfo);
   mutableUserInfo.setRealm(MissionControlAuthenticationProvider.REALM);
   userInfo = mutableUserInfo;
   SimpleUser user = new SimpleUser(userInfo);
   // create new authentication response containing the user and it's authorities.
   log.debug("Finished to create Anonymous authentication");
   return new MissionControlAuthenticationToken(user, user.getAuthorities());
 }