]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms/src/org/argeo/cms/auth/HttpSessionLoginModule.java
Major refactoring of Argeo CMS UI
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / auth / HttpSessionLoginModule.java
index acc0ba4e8ff58ee0a4fc437e24065bc5ab5873fc..c2dfead780ac8c9d71e2bbc932eafad00c15321e 100644 (file)
@@ -19,7 +19,7 @@ import javax.servlet.http.HttpSession;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.argeo.cms.CmsException;
+import org.argeo.cms.internal.auth.CmsSessionImpl;
 import org.argeo.cms.internal.kernel.Activator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkUtil;
@@ -74,7 +74,7 @@ public class HttpSessionLoginModule implements LoginModule {
                        String httpSessionId = httpSession.getId();
                        if (log.isTraceEnabled())
                                log.trace("HTTP login: " + request.getPathInfo() + " #" + httpSessionId);
-                       CmsSession cmsSession = CmsAuthUtils.cmsSessionFromHttpSession(bc, httpSessionId);
+                       CmsSessionImpl cmsSession = CmsAuthUtils.cmsSessionFromHttpSession(bc, httpSessionId);
                        if (cmsSession != null) {
                                authorization = cmsSession.getAuthorization();
                                locale = cmsSession.getLocale();
@@ -94,7 +94,7 @@ public class HttpSessionLoginModule implements LoginModule {
                                String httpSessionId = httpSession.getId();
                                if (log.isTraceEnabled())
                                        log.trace("HTTP login: " + request.getPathInfo() + " #" + httpSessionId);
-                               CmsSession cmsSession = CmsAuthUtils.cmsSessionFromHttpSession(bc, httpSessionId);
+                               CmsSessionImpl cmsSession = CmsAuthUtils.cmsSessionFromHttpSession(bc, httpSessionId);
                                if (cmsSession != null) {
                                        authorization = cmsSession.getAuthorization();
                                        locale = cmsSession.getLocale();
@@ -182,10 +182,10 @@ public class HttpSessionLoginModule implements LoginModule {
                                                        sharedState.put(CmsAuthUtils.SHARED_STATE_NAME, login);
                                                        sharedState.put(CmsAuthUtils.SHARED_STATE_PWD, password);
                                                } else {
-                                                       throw new CmsException("Invalid authentication token");
+                                                       throw new IllegalStateException("Invalid authentication token");
                                                }
                                        } catch (Exception e) {
-                                               throw new CmsException("Couldn't retrieve authentication", e);
+                                               throw new IllegalStateException("Couldn't retrieve authentication", e);
                                        }
                                } else if (basic.equalsIgnoreCase("Negotiate")) {
                                        String spnegoToken = st.nextToken();