Skip to main content

Passing a data source as an OSGi ldap filter

To use an OSGi ldap filter, the prefix osgi: needs to be provided. See the example below:

<jaas:config name="karaf">
   <jaas:module 
      className="org.apache.karaf.jaas.modules.jdbc.JDBCLoginModule" 
      flags="required">
      datasource = osgi:javax.sql.DataSource/   \\
         (osgi.jndi.service.name=jdbc/karafdb)
      query.password = SELECT PASSWORD FROM USERS WHERE USERNAME=?
      query.role = SELECT ROLE FROM ROLES WHERE USERNAME=?
   </jaas:module>
</jaas:config>

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!