Description
Typically it is recommended to deploy the following Blueprint context in order to enable a JAAS PropertiesLoginModule shipped with Karaf:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.0.0" xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"> <!-- Bean to allow the $[karaf.base] property to be correctly resolved --> <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"/> <jaas:config name="karaf"> <jaas:module className="org.apache.karaf.jaas.modules.properties.PropertiesLoginModule" flags="required"> users=$[karaf.base]/etc/users.properties </jaas:module> </jaas:config> </blueprint>
and here is a typical pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>my-service-jaas</artifactId> <name>Service JAAS</name> <packaging>bundle</packaging> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>org.apache.karaf.jaas</groupId> <artifactId>org.apache.karaf.jaas.config</artifactId> <version>2.1.2</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <configuration> <instructions> <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> <Import-Package> javax.net.ssl, javax.security.auth.login, org.osgi.service.blueprint, org.apache.karaf.jaas.config, org.apache.karaf.jaas.boot, </Import-Package> <DynamicImport-Package>*</DynamicImport-Package> </instructions> </configuration> </plugin> </plugins> </build> </project>
Such a bundle is generic and will work with any service depending on PropertiesLoginModule.
It would be nice if Karaf itself shipped such a bundle and offered an optional feature, tentatively named 'karaf-jaas-login-properties' (or similar) so that whenever a user want to work with PropertiesLoginModule all he/she needs to do is to modify etc/user.properties and do 'features:install karaf-jaas-login-properties'.
Note it is not a new enhancement request but simply a wish to get the default properties login module easily enabled when needed