Skip to content

Instantly share code, notes, and snippets.

@iocanel
Created March 5, 2012 17:24
Show Gist options
  • Select an option

  • Save iocanel/1979609 to your computer and use it in GitHub Desktop.

Select an option

Save iocanel/1979609 to your computer and use it in GitHub Desktop.
A simple jdbc login module for Karaf JAAS
<blueprint xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0" xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.0.0" xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"> </ext:property-placeholder>
<jaas:config name="blog">
<jaas:module classname="org.apache.karaf.jaas.modules.jdbc.JDBCLoginModule" flags="required">
datasource = osgi:javax.sql.DataSource/(osgi.jndi.service.name=jdbc/blogdb)
query.password = SELECT PASSWORD FROM users WHERE USERNAME=?
query.role = SELECT ROLE FROM roles WHERE USERNAME=?
encryption.name = jasypt
encryption.algorithm = MD5
encryption.encoding = hexadecimal
encryption.iterations = 1
encryption.saltSizeBytes = 0
encryption.enabled = true
role.policy = prefix
role.discriminator = ROLE_
</jaas:module>
</jaas:config>
</blueprint>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment