Admin session to the proper content provider workspace
[lgpl/argeo-commons.git] / org.argeo.api.cms / src / org / argeo / api / cms / CmsAuth.java
index decea35508a4da5db931fc3b44a4a7732d5b68d7..31ec8be5071f63dce2eaa4b0e89bb13dfd0c10e6 100644 (file)
@@ -1,5 +1,6 @@
 package org.argeo.api.cms;
 
+import javax.security.auth.Subject;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
@@ -21,6 +22,18 @@ public enum CmsAuth {
                return new LoginContext(getLoginContextName(), callbackHandler);
        }
 
+       public LoginContext newLoginContext(Subject subject, CallbackHandler callbackHandler) throws LoginException {
+               return new LoginContext(getLoginContextName(), subject, callbackHandler);
+       }
+
+       public LoginContext newLoginContext(Subject subject) throws LoginException {
+               return new LoginContext(getLoginContextName(), subject);
+       }
+
+       public LoginContext newLoginContext() throws LoginException {
+               return new LoginContext(getLoginContextName());
+       }
+
        /*
         * LOGIN CONTEXTS
         */