]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms/src/org/argeo/cms/auth/CmsAuthUtils.java
Adapt after Argeo Suite refactoring.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / auth / CmsAuthUtils.java
index e854f5adfcd213bfbf31e2de2f97f3c44247727c..72676611e4e43f631429c52e8b31a6a0893e4529 100644 (file)
@@ -10,18 +10,16 @@ import javax.naming.InvalidNameException;
 import javax.naming.ldap.LdapName;
 import javax.security.auth.Subject;
 import javax.security.auth.x500.X500Principal;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
 
-import org.argeo.api.NodeConstants;
 import org.argeo.api.cms.CmsSession;
 import org.argeo.api.cms.CmsSessionId;
-import org.argeo.api.security.AnonymousPrincipal;
-import org.argeo.api.security.DataAdminPrincipal;
-import org.argeo.api.security.NodeSecurityUtils;
+import org.argeo.api.cms.DataAdminPrincipal;
+import org.argeo.api.cms.AnonymousPrincipal;
+import org.argeo.api.cms.CmsConstants;
 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.security.NodeSecurityUtils;
 import org.argeo.osgi.useradmin.AuthenticatingUser;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.InvalidSyntaxException;
@@ -124,16 +122,16 @@ class CmsAuthUtils {
        }
 
        @SuppressWarnings("unused")
-       synchronized static void registerSessionAuthorization(HttpServletRequest request, Subject subject,
+       synchronized static void registerSessionAuthorization(RemoteAuthRequest request, Subject subject,
                        Authorization authorization, Locale locale) {
                // synchronized in order to avoid multiple registrations
                // TODO move it to a service in order to avoid static synchronization
                if (request != null) {
-                       HttpSession httpSession = request.getSession(false);
+                       RemoteAuthSession httpSession = request.getSession();
                        assert httpSession != null;
                        String httpSessId = httpSession.getId();
                        boolean anonymous = authorization.getName() == null;
-                       String remoteUser = !anonymous ? authorization.getName() : NodeConstants.ROLE_ANONYMOUS;
+                       String remoteUser = !anonymous ? authorization.getName() : CmsConstants.ROLE_ANONYMOUS;
                        request.setAttribute(HttpContext.REMOTE_USER, remoteUser);
                        request.setAttribute(HttpContext.AUTHORIZATION, authorization);