]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms/src/org/argeo/cms/internal/kernel/NodeSecurity.java
Fix issue with session authentication in web.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / kernel / NodeSecurity.java
index aed824fbdff830b3b21f0cbd7ba22c39e48e6821..910953e30e60a1b1ad742de376cbaf37f1fe262c 100644 (file)
@@ -29,12 +29,9 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.useradmin.UserAdmin;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.AuthenticationException;
 
 /** Authentication and user management. */
-class NodeSecurity implements AuthenticationManager {
+class NodeSecurity {
        private final static Log log;
        static {
                log = LogFactory.getLog(NodeSecurity.class);
@@ -54,8 +51,6 @@ class NodeSecurity implements AuthenticationManager {
        private final NodeUserAdmin userAdmin;
        private final Subject kernelSubject;
 
-       private ServiceRegistration<AuthenticationManager> authenticationManagerReg;
-
        private ServiceRegistration<UserAdmin> userAdminReg;
 
        public NodeSecurity(BundleContext bundleContext) {
@@ -101,18 +96,11 @@ class NodeSecurity implements AuthenticationManager {
        }
 
        public void publish() {
-               authenticationManagerReg = bundleContext.registerService(
-                               AuthenticationManager.class, this, null);
-               Hashtable<String, Object> properties = new Hashtable<String, Object>();
-               // properties.put(KernelConstants.USERADMIN_URI,
-               // userAdmin.asConfigUris());
                userAdminReg = bundleContext.registerService(UserAdmin.class,
-                               userAdmin, properties);
-       }
+                               userAdmin, userAdmin.currentState());
+               }
 
        void destroy() {
-               authenticationManagerReg.unregister();
-
                userAdmin.destroy();
                userAdminReg.unregister();
 
@@ -136,14 +124,6 @@ class NodeSecurity implements AuthenticationManager {
                return kernelSubject;
        }
 
-       @Override
-       public Authentication authenticate(Authentication authentication)
-                       throws AuthenticationException {
-               log.error("Authentication manager is deprecated and should not be used.");
-               throw new ProviderNotFoundException(
-                               "Authentication manager is deprecated and should not be used.");
-       }
-
        private void createKeyStoreIfNeeded() {
                char[] ksPwd = "changeit".toCharArray();
                char[] keyPwd = Arrays.copyOf(ksPwd, ksPwd.length);