- // CmsSession cmsSession;
- // if (sr.size() == 1) {
- // cmsSession = bc.getService(sr.iterator().next());
- // } else if (sr.size() == 0) {
- // Hashtable<String, String> props = new Hashtable<>();
- // props.put(CmsSession.CMS_DN, authorization.getName());
- // props.put(CmsSession.CMS_SESSION_ID, sessionId);
- // cmsSession = new CmsSessionImpl(sessionId, authorization);
- // bc.registerService(CmsSession.class, cmsSession, props);
- // if (log.isDebugEnabled())
- // log.debug("Initialized " + cmsSession + " for " +
- // authorization.getName());
- // } else
- // throw new CmsException(sr.size() + " CMS sessions registered for " +
- // sessionId);
- // cmsSession.addHttpSession(request);
- // if (log.isTraceEnabled())
- // log.trace("Added " + request.getServletPath() + " to " + cmsSession +
- // " (" + request.getRequestURI()
- // + ")");
- // httpSession.setAttribute(HttpContext.AUTHORIZATION, authorization);
- // }
- // subject.getPrivateCredentials().add(request.getSession());
- // }
- return true;
+ if (authorization == null) {
+ return false;
+ // throw new LoginException("Authorization should not be null");
+ } else {
+ CmsAuthUtils.addAuthentication(subject, authorization);
+ return true;
+ }