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);
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) {
display.syncExec(() -> {
// CmsFeedback.show("Unexpected exception in CMS", e);
exception = e;
-// log.error("Unexpected exception in CMS", e);
+ log.error("Unexpected exception in CMS", e);
doRefresh();
});
}
@Override
public CmsSession getCmsSession() {
CmsSession cmsSession = cmsWebApp.getCmsApp().getCmsContext().getCmsSession(getSubject());
+ if (cmsSession == null)
+ throw new IllegalStateException("No CMS session available for " + getSubject());
return cmsSession;
}