Add the Karaf jaas feature as runtime prerequisite (#1398)

* Add the Karaf jaas feature as runtime prerequisite
* Remove LoginModule reference from ManagedUserRealm

Signed-off-by: Yannick Schaus <github@schaus.net>
pull/1403/head
Yannick Schaus 2020-03-25 12:40:59 +01:00 committed by GitHub
parent d8fce0b8b3
commit 15b3b07614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 16 deletions

View File

@ -18,18 +18,12 @@ import java.util.Map;
import javax.inject.Singleton;
import javax.security.auth.login.AppConfigurationEntry;
import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag;
import javax.security.auth.spi.LoginModule;
import org.apache.karaf.jaas.boot.ProxyLoginModule;
import org.apache.karaf.jaas.config.JaasRealm;
import org.apache.karaf.shell.api.action.lifecycle.Service;
import org.openhab.core.auth.UserRegistry;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A JAAS realm description for the {@link UserRegistry} based login module.
@ -44,16 +38,6 @@ public class ManagedUserRealm implements JaasRealm {
public static final String REALM_NAME = "openhab";
public static final String MODULE_CLASS = "org.openhab.core.auth.jaas.internal.ManagedUserLoginModule";
private final Logger logger = LoggerFactory.getLogger(ManagedUserRealm.class);
BundleContext bundleContext;
@Activate
public ManagedUserRealm(BundleContext bundleContext, @Reference LoginModule loginModule) {
this.bundleContext = bundleContext;
logger.debug("Using login module {} for the openhab realm", loginModule.getClass().getCanonicalName());
}
@Override
public String getName() {
return REALM_NAME;

View File

@ -455,6 +455,7 @@
<feature>openhab-transport-http</feature>
<feature prerequisite="true">shell</feature>
<feature prerequisite="true">wrapper</feature>
<feature prerequisite="true">jaas</feature>
<!-- This bundle needs to be started early as it registers the 404 and startup pages on Jetty -->
<!-- It is temperarily disabled due to https://github.com/openhab/openhab-core/issues/422 -->
<!-- <bundle start-level="30">mvn:org.openhab.core.bundles/org.openhab.ui.start/${project.version}</bundle> -->