Fix anonymous login
[lgpl/argeo-commons.git] / rap / org.argeo.cms.ui.rap / src / org / argeo / cms / web / CmsWebEntryPoint.java
index c82aca7285d21c24d6ccec080ee84119440d469a..2eb783527f790b8cac6802e58ccb1ac94f8c4db2 100644 (file)
@@ -89,7 +89,9 @@ public class CmsWebEntryPoint implements EntryPoint, CmsView, BrowserNavigationL
                        lc.login();
                } catch (LoginException e) {
                        try {
-                               lc = new LoginContext(CmsAuth.LOGIN_CONTEXT_ANONYMOUS);
+                               lc = new LoginContext(CmsAuth.LOGIN_CONTEXT_ANONYMOUS,
+                                               new RemoteAuthCallbackHandler(new ServletHttpRequest(UiContext.getHttpRequest()),
+                                                               new ServletHttpResponse(UiContext.getHttpResponse())));
                                lc.login();
                        } catch (LoginException e1) {
                                throw new IllegalStateException("Cannot log in as anonymous", e1);
@@ -154,7 +156,9 @@ public class CmsWebEntryPoint implements EntryPoint, CmsView, BrowserNavigationL
                try {
                        CurrentUser.logoutCmsSession(loginContext.getSubject());
                        loginContext.logout();
-                       LoginContext anonymousLc = new LoginContext(CmsAuth.LOGIN_CONTEXT_ANONYMOUS);
+                       LoginContext anonymousLc = new LoginContext(CmsAuth.LOGIN_CONTEXT_ANONYMOUS,
+                                       new RemoteAuthCallbackHandler(new ServletHttpRequest(UiContext.getHttpRequest()),
+                                                       new ServletHttpResponse(UiContext.getHttpResponse())));
                        anonymousLc.login();
                        authChange(anonymousLc);
                } catch (LoginException e) {