import javax.security.auth.login.LoginContext;
import javax.security.auth.login.LoginException;
-import org.argeo.api.NodeConstants;
+import org.argeo.api.cms.CmsAuth;
import org.argeo.api.cms.CmsImageManager;
import org.argeo.api.cms.CmsView;
import org.argeo.api.cms.UxContext;
@Override
public Object start(IApplicationContext context) throws Exception {
+ // TODO wait for CMS to be ready
+ Thread.sleep(5000);
+
uid = UUID.randomUUID().toString();
Subject subject = new Subject();
Display display = createDisplay();
- CmsLoginShell loginShell = new CmsLoginShell(this);
+ CmsLoginShell loginShell = new CmsLoginShell(this, null);
// TODO customize CmsLoginShell to be smaller and centered
loginShell.setSubject(subject);
try {
// try pre-auth
- loginContext = new LoginContext(NodeConstants.LOGIN_CONTEXT_USER, subject, loginShell);
+ loginContext = new LoginContext(CmsAuth.LOGIN_CONTEXT_SINGLE_USER, subject, loginShell);
loginContext.login();
} catch (LoginException e) {
e.printStackTrace();
// }
uxContext = new SimpleSwtUxContext();
- //UiContext.setData(CmsView.KEY, this);
+ // UiContext.setData(CmsView.KEY, this);
CmsSwtUtils.registerCmsView(loginShell.getShell(), this);
e4Application = getApplication(null);
Object res = Subject.doAs(subject, new PrivilegedExceptionAction<Object>() {
return uid;
}
-
}