- // Subject subject = KernelUtils.anonymousLogin();
- // authorization =
- // subject.getPrivateCredentials(Authorization.class).iterator().next();
- // request.setAttribute(REMOTE_USER,
- // NodeConstants.ROLE_ANONYMOUS);
- // request.setAttribute(AUTHORIZATION, authorization);
- // httpSession.setAttribute(REMOTE_USER,
- // NodeConstants.ROLE_ANONYMOUS);
- // httpSession.setAttribute(AUTHORIZATION, authorization);
- // return true;
- // CallbackHandler token = basicAuth(request);
- // if (token != null) {
- // try {
- // LoginContext lc = new
- // LoginContext(NodeConstants.LOGIN_CONTEXT_USER, token);
- // lc.login();
- // // Note: this is impossible to reliably clear the
- // // authorization header when access from a browser.
- // return true;
- // } catch (LoginException e1) {
- // throw new CmsException("Could not login", e1);
- // }
- // } else {
- // String path = request.getServletPath();
- // if (path.startsWith(REMOTING_PRIVATE))
- // requestBasicAuth(request, response);
- // return false;
- // }
- } catch (LoginException e) {
- throw new CmsException("Could not login", e);