About user autentication it must be something like it:
On login-config.xml
<application-policy name="OpenKM">
<authentication>
<login-module code ="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
<module-option name = "unauthenticatedIdentity">Anonymous</module-option>
<module-option name="dsJndiName">java:/jndi.datasource.name.db</module-option>
<module-option name="principalsQuery">select user_pwd_table as PASSWD from user_table where user_name=?</module-option>
<module-option name="rolesQuery">select role_name as ROLEID, 'Roles' from user_table, roles_table where user_roles_name=user_name and user_name=?</module-option>
</login-module>
</authentication>
</application-policy>
The query it'll be dependant on your table structure ( remember it, it's only and exemple of how could be )
Some file called datasource-ds.xml or something fileXXX-ds.xml to create jndi name like it
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>jndi.datasource.name.db</jndi-name>
<connection-url>jdbc

ostgresql://localhost/you_databasename</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>user</user-name>
<password>pwd</password>
</local-tx-datasource>
</datasources>