import org.argeo.api.cms.DataAdminPrincipal;
import org.argeo.cms.internal.auth.CmsSessionImpl;
import org.argeo.cms.internal.auth.ImpliedByPrincipal;
-import org.argeo.cms.internal.http.WebCmsSessionImpl;
+import org.argeo.cms.internal.auth.RemoteCmsSessionImpl;
import org.argeo.cms.internal.runtime.CmsContextImpl;
import org.argeo.osgi.useradmin.AuthenticatingUser;
-import org.osgi.service.http.HttpContext;
import org.osgi.service.useradmin.Authorization;
/** Centralises security related registrations. */
// Standard
final static String SHARED_STATE_NAME = AuthenticatingUser.SHARED_STATE_NAME;
final static String SHARED_STATE_PWD = AuthenticatingUser.SHARED_STATE_PWD;
- final static String HEADER_AUTHORIZATION = "Authorization";
- final static String HEADER_WWW_AUTHENTICATE = "WWW-Authenticate";
+// final static String HEADER_AUTHORIZATION = "Authorization";
+// final static String HEADER_WWW_AUTHENTICATE = "WWW-Authenticate";
// Argeo specific
final static String SHARED_STATE_HTTP_REQUEST = "org.argeo.cms.auth.http.request";
String httpSessId = httpSession.getId();
boolean anonymous = authorization.getName() == null;
String remoteUser = !anonymous ? authorization.getName() : CmsConstants.ROLE_ANONYMOUS;
- request.setAttribute(HttpContext.REMOTE_USER, remoteUser);
- request.setAttribute(HttpContext.AUTHORIZATION, authorization);
+ request.setAttribute(RemoteAuthRequest.REMOTE_USER, remoteUser);
+ request.setAttribute(RemoteAuthRequest.AUTHORIZATION, authorization);
CmsSessionImpl cmsSession;
CmsSessionImpl currentLocalSession = CmsContextImpl.getCmsContext().getCmsSessionByLocalId(httpSessId);
currentLocalSession.close();
// new CMS session
UUID cmsSessionUuid = CmsContextImpl.getCmsContext().getUuidFactory().timeUUID();
- cmsSession = new WebCmsSessionImpl(cmsSessionUuid, subject, authorization, locale, request);
+ cmsSession = new RemoteCmsSessionImpl(cmsSessionUuid, subject, authorization, locale, request);
CmsContextImpl.getCmsContext().registerCmsSession(cmsSession);
} else if (!authorization.getName().equals(currentLocalSession.getAuthorization().getName())) {
throw new IllegalStateException("Inconsistent user " + authorization.getName()
} else {
// new CMS session
UUID cmsSessionUuid = CmsContextImpl.getCmsContext().getUuidFactory().timeUUID();
- cmsSession = new WebCmsSessionImpl(cmsSessionUuid, subject, authorization, locale, request);
+ cmsSession = new RemoteCmsSessionImpl(cmsSessionUuid, subject, authorization, locale, request);
CmsContextImpl.getCmsContext().registerCmsSession(cmsSession);
}