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);
private final NodeUserAdmin userAdmin;
private final Subject kernelSubject;
- private ServiceRegistration<AuthenticationManager> authenticationManagerReg;
-
private ServiceRegistration<UserAdmin> userAdminReg;
public NodeSecurity(BundleContext bundleContext) {
public void publish() {
userAdminReg = bundleContext.registerService(UserAdmin.class,
userAdmin, userAdmin.currentState());
- // dummy auth manager, in order to smooth transition from Argeo 1
- authenticationManagerReg = bundleContext.registerService(
- AuthenticationManager.class, this, null);
- }
+ }
void destroy() {
- authenticationManagerReg.unregister();
-
userAdmin.destroy();
userAdminReg.unregister();
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);