Page 1 of 2

OpenKM 4 Authentication with Postgresql

PostPosted:Wed Apr 07, 2010 6:20 pm
by mribeiro
Hi!

I've been trying to make OpenKM authentication through PostgreSQL.
I edited the "openkm-ds.xml" file to the following:
Code: Select all
<?xml version=\"1.0\" encoding=\"UTF-8\"?>

<datasources>
<!-- OpenKM User Activity -->
<local-tx-datasource>
<jndi-name>>OKMActivityDS</jndi-name>
<connection-url>jdbc:postgresql://localhost/OKMActivity</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
<password>postgres</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<track-statements/>
<!--<security-domain>HsqlDbRealm</security-domain>-->
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<metadata>
<type-mapping>PostgreSQL 8.0</type-mapping>
</metadata>
<depends>jboss:service=Postgres,database=OKMActivity</depends>
</local-tx-datasource>

<!-- For hsqldb accessed from jboss only, in-process (standalone) mode
<mbean code=\"org.postgresql\"
name=\"jboss:service=Postgres,database=OKMActivity\">
<attribute name=\"Database\">OKMActivity</attribute>
<attribute name=\"InProcessMode\">true</attribute>
</mbean> -->

<!-- OpenKM User Auth -->
<local-tx-datasource>
<jndi-name>OKMAuthDS</jndi-name>
<connection-url>jdbc:postgresql://localhost/OKMAuth</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
<password>postgres</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<track-statements/>
<!--<security-domain>HsqlDbRealm</security-domain>-->
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<metadata>
<type-mapping>PostgreSQL 8.0</type-mapping>
</metadata>
<depends>jboss:service=Postgres,database=OKMAuth</depends>
</local-tx-datasource>

<!-- For hsqldb accessed from jboss only, in-process (standalone) mode
<mbean code=\"org.postgresql\"
name=\"jboss:service=Hypersonic,database=OKMAuth\">
<attribute name=\"Database\">OKMAuth</attribute>
<attribute name=\"InProcessMode\">true</attribute>
</mbean> -->

<!-- OpenKM Dashboard Stats -->
<local-tx-datasource>
<jndi-name>OKMDashboardStatsDS</jndi-name>
<connection-url>jdbc:postgresql://localhost/OKMDashboardStats</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
<password>postgres</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<track-statements/>
<!--<security-domain>HsqlDbRealm</security-domain>-->
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<metadata>
<type-mapping>PostgreSQL 8.0</type-mapping>
</metadata>
<depends>jboss:service=Postgres,database=OKMDashboardStats</depends>
</local-tx-datasource>

<!-- For hsqldb accessed from jboss only, in-process (standalone) mode
<mbean code=\"org.jboss.jdbc.HypersonicDatabase\"
name=\"jboss:service=Hypersonic,database=OKMDashboardStats\">
<attribute name=\"Database\">OKMDashboardStats</attribute>
<attribute name=\"InProcessMode\">true</attribute>
</mbean> -->
</datasources> 
Some notes: I already put it to save documents into the Postgresql database (my only problem is only with the security stuff) and all the databases, usernames and passwords are correct.

I don't know what to look for in the server.log so I attached and hope that someone can help me (since txt or log extensions aren't allowed, I uploaded it to:http://afac-online.org/server.txt )

Hope you can help me...
Thanks in advance

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Thu Apr 08, 2010 3:25 pm
by jllort
try login-config.xml query to postgresql ( for example in mysql is needed to remove 'true' to true without character ')

in other hand, remember passwords are encripted, by default configured in login-config.xml, here you've got two options, removing it or copying the exact password of okmAdmin.

I suppose you've created tables in this postgre database no ?

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Thu Apr 08, 2010 7:40 pm
by mribeiro
Ok, here's the thing... For this project I'm developing, i will only need the documents and authentication via Postgresql, i. e., I only intend to port the OKMAuth database to postgres. Is that possible? If not (i.ei, if I have to create all the databases and tables in postgres) is there anyway that I can create them with a script or something? Duplicating those databases will give some extra extra work...

Right now, here is how I got my files:

OpenKM.cfg (added the last line)
Code: Select all
# Default configuration values
#
# repository.config=repository.xml
# repository.home=repository
# system.user=system
# default.user.role=UserRol
# default.admin.role=AdminRol
# principal.adapter=es.git.openkm.core.UsersRolesPrincipalAdapter
# max.file.size=5
# max.search.results=25
# system.demo=off
# update.info=off
# system.ocr=/usr/bin/tesseract
# system.openoffice=on
# system.pdf2swf=/usr/bin/pdf2swf
# system.readonly=off
# system.antivir=/usr/bin/clamscan
restrict.file.mime=off
restrict.file.extension=*~,*.bak,._*
principal.adapter=es.git.openkm.principal.DatabasePrincipalAdapter
login-config.xml (only changed things refering to OpenKM ; removed hash to put plain password in DB just for testing)
Code: Select all
<application-policy name = "OpenKM">
      <authentication>
        <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
          <module-option name="dsJndiName">java:/OKMAuthDS</module-option>
          <module-option name="principalsQuery">select usr_pass as PASSWD from users where usr_id=?</module-option>
          <module-option name="rolesQuery">select ur_role as ROLEID, 'Roles' from user_role where ur_user=?</module-option>
        </login-module>
        <login-module code="org.jboss.security.ClientLoginModule" flag="required" />
      </authentication>
    </application-policy>
openkm-ds.xml Only changed authentication settings (the rest remained by default)
Code: Select all
<!-- OpenKM User Auth -->
  <local-tx-datasource>
    <jndi-name>OKMAuthDS</jndi-name>
    <connection-url>jdbc:postgresql://localhost/okmAuth</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
    <user-name>postgres</user-name>
    <password>123456</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <idle-timeout-minutes>0</idle-timeout-minutes>
    <track-statements/>
    <!--<security-domain>HsqlDbRealm</security-domain>-->
    <prepared-statement-cache-size>32</prepared-statement-cache-size>
    <metadata>
      <type-mapping>PostgreSQL 8.0</type-mapping><!-- Actually i'm using PostgreSQL 8.4, but is this relevant?  -->
    </metadata>
  </local-tx-datasource>

I don't if this is possible... and I've been reading some documentation but I'm kinda new to this...

Thank you for your patiente :)

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Fri Apr 09, 2010 7:39 am
by pavila
You can find the database definitions for OpenKM 4.0 at https://openkm.svn.sourceforge.net/svnr ... penkm/dao/. These are for HSQL but can be migrated to PostgreSQL easilly.

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Fri Apr 09, 2010 12:29 pm
by mribeiro
thanks pavila!

Now I have all the databases structure created in my postgre server but still with some problems...
I've been "tweaking" my xml and cfg files a little bit more and I got to this:

OpenKM.cfg
Code: Select all
# Default configuration values
#
# repository.config=repository.xml
# repository.home=repository
# system.user=system
# default.user.role=UserRol
# default.admin.role=AdminRol
# principal.adapter=es.git.openkm.core.UsersRolesPrincipalAdapter
# max.file.size=5
# max.search.results=25
# system.demo=off
# update.info=off
# system.ocr=/usr/bin/tesseract
# system.openoffice=on
# system.pdf2swf=/usr/bin/pdf2swf
# system.readonly=off
# system.antivir=/usr/bin/clamscan
restrict.file.mime=off
restrict.file.extension=*~,*.bak,._*
principal.adapter=es.git.openkm.principal.DatabasePrincipalAdapter
login-config.xml
Code: Select all
<?xml version='1.0'?>
<!DOCTYPE policy PUBLIC
      "-//JBoss//DTD JBOSS Security Config 3.0//EN"
      "http://www.jboss.org/j2ee/dtd/security_config.dtd">

<!-- The XML based JAAS login configuration read by the
org.jboss.security.auth.login.XMLLoginConfig mbean. Add
an application-policy element for each security domain.

The outline of the application-policy is:
<application-policy name="security-domain-name">
  <authentication>
    <login-module code="login.module1.class.name" flag="control_flag">
      <module-option name = "option1-name">option1-value</module-option>
      <module-option name = "option2-name">option2-value</module-option>
      ...
    </login-module>

    <login-module code="login.module2.class.name" flag="control_flag">
      ...
    </login-module>
    ...
  </authentication>
</application-policy>

$Revision: 64598 $
-->

<policy>
    <!-- Used by clients within the application server VM such as
    mbeans and servlets that access EJBs.
    -->
    <application-policy name = "client-login">
       <authentication>
          <login-module code = "org.jboss.security.ClientLoginModule"
             flag = "required">
             <!-- Any existing security context will be restored on logout -->
             <module-option name="restore-login-identity">true</module-option>
          </login-module>
       </authentication>
    </application-policy>

    <!-- Security domain for JBossMQ -->
    <application-policy name = "jbossmq">
       <authentication>
          <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
             flag = "required">
             <module-option name = "unauthenticatedIdentity">guest</module-option>
             <module-option name = "dsJndiName">java:/DefaultDS</module-option>
             <module-option name = "principalsQuery">SELECT PASSWD FROM JMS_USERS WHERE USERID=?</module-option>
             <module-option name = "rolesQuery">SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</module-option>
          </login-module>
       </authentication>
    </application-policy>

    <!-- Security domain for JBossMQ when using file-state-service.xml
    <application-policy name = "jbossmq">
       <authentication>
          <login-module code = "org.jboss.mq.sm.file.DynamicLoginModule"
             flag = "required">
             <module-option name = "unauthenticatedIdentity">guest</module-option>
             <module-option name = "sm.objectname">jboss.mq:service=StateManager</module-option>
          </login-module>
       </authentication>
    </application-policy>
    -->

    <!-- Security domains for testing new jca framework -->
    <application-policy name = "HsqlDbRealm">
       <authentication>
          <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
             flag = "required">
             <module-option name = "principal">sa</module-option>
             <module-option name = "userName">sa</module-option>
             <module-option name = "password"></module-option>
             <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
          </login-module>
       </authentication>
    </application-policy>

    <application-policy name = "JmsXARealm">
       <authentication>
          <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
             flag = "required">
             <module-option name = "principal">guest</module-option>
             <module-option name = "userName">guest</module-option>
             <module-option name = "password">guest</module-option>
             <module-option name = "managedConnectionFactoryName">jboss.jca:service=TxCM,name=JmsXA</module-option>
          </login-module>
       </authentication>
    </application-policy>

    <!-- A template configuration for the jmx-console web application. This
      defaults to the UsersRolesLoginModule the same as other and should be
      changed to a stronger authentication mechanism as required.
    -->
    <application-policy name = "jmx-console">
       <authentication>
          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
             flag = "required">
           <module-option name="usersProperties">props/jmx-console-users.properties</module-option>
           <module-option name="rolesProperties">props/jmx-console-roles.properties</module-option>
          </login-module>
       </authentication>
    </application-policy>

    <!-- A template configuration for the web-console web application. This
      defaults to the UsersRolesLoginModule the same as other and should be
      changed to a stronger authentication mechanism as required.
    -->
    <application-policy name = "web-console">
       <authentication>
          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
             flag = "required">
             <module-option name="usersProperties">web-console-users.properties</module-option>
             <module-option name="rolesProperties">web-console-roles.properties</module-option>
          </login-module>
       </authentication>
    </application-policy>

    <!--
      A template configuration for the JBossWS security domain.
      This defaults to the UsersRolesLoginModule the same as other and should be
      changed to a stronger authentication mechanism as required.
    -->
    <application-policy name="JBossWS">
      <authentication>
        <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
          flag="required">
          <module-option name="usersProperties">props/jbossws-users.properties</module-option>
          <module-option name="rolesProperties">props/jbossws-roles.properties</module-option>
          <module-option name="unauthenticatedIdentity">anonymous</module-option>
        </login-module>
      </authentication>
    </application-policy>

    <!-- OpenKM -->
    <application-policy name = "OpenKM">
       <authentication>
          <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
            <module-option name="dsJndiName">java:/OKMAuthDS</module-option>
            <module-option name="principalsQuery">select usr_pass as PASSWD from users where usr_id=? and usr_active='true'</module-option>
            <module-option name="rolesQuery">select ur_role as ROLEID, 'Roles' from user_role where ur_user=?</module-option>
            <module-option name="hashAlgorithm">md5</module-option>
            <module-option name="hashEncoding">hex</module-option>
          </login-module>
       </authentication>
    </application-policy>

    <!-- The default login configuration used by any security domain that
    does not have a application-policy entry with a matching name
    -->
    <application-policy name = "other">
       <!-- A simple server login module, which can be used when the number
       of users is relatively small. It uses two properties files:
       users.properties, which holds users (key) and their password (value).
       roles.properties, which holds users (key) and a comma-separated list of
       their roles (value).
       The unauthenticatedIdentity property defines the name of the principal
       that will be used when a null username and password are presented as is
       the case for an unuathenticated web client or MDB. If you want to
       allow such users to be authenticated add the property, e.g.,
       unauthenticatedIdentity="nobody"
       -->
       <authentication>
          <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
             flag = "required" />
       </authentication>
    </application-policy>

</policy>
openkm-ds.xml
Code: Select all
<?xml version="1.0" encoding="utf-8"?>

<datasources>
  <!-- OpenKM User Activity -->
  <local-tx-datasource>
    <jndi-name>>OKMActivityDS</jndi-name>
    <connection-url>jdbc:postgresql://localhost/OKMActivity</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
    <user-name>postgres</user-name>
    <password>123456</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <idle-timeout-minutes>0</idle-timeout-minutes>
    <track-statements/>
    <!--<security-domain>HsqlDbRealm</security-domain>-->
    <prepared-statement-cache-size>32</prepared-statement-cache-size>
    <metadata>
      <type-mapping>PostgreSQL 8.0</type-mapping>
    </metadata>
    <!--<depends>jboss:service=Postgres,database=OKMActivity</depends>-->
  </local-tx-datasource>

  <!-- For hsqldb accessed from jboss only, in-process (standalone) mode
<mbean code=\"org.postgresql\"
name=\"jboss:service=Postgres,database=OKMActivity\">
<attribute name=\"Database\">OKMActivity</attribute>
<attribute name=\"InProcessMode\">true</attribute>
</mbean> -->

  <!-- OpenKM User Auth -->
  <local-tx-datasource>
    <jndi-name>OKMAuthDS</jndi-name>
    <connection-url>jdbc:postgresql://localhost/OKMAuthDS</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
    <user-name>postgres</user-name>
    <password>123456</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <idle-timeout-minutes>0</idle-timeout-minutes>
    <track-statements/>
    <!--<security-domain>HsqlDbRealm</security-domain>-->
    <prepared-statement-cache-size>32</prepared-statement-cache-size>
    <metadata>
      <type-mapping>PostgreSQL 8.0</type-mapping>
    </metadata>
    <!--<depends>jboss:service=Postgres,database=OKMAuthDS</depends>-->
  </local-tx-datasource>

  <!-- For hsqldb accessed from jboss only, in-process (standalone) mode
<mbean code=\"org.postgresql\"
name=\"jboss:service=Hypersonic,database=OKMAuth\">
<attribute name=\"Database\">OKMAuth</attribute>
<attribute name=\"InProcessMode\">true</attribute>
</mbean> -->

  <!-- OpenKM Dashboard Stats -->
  <local-tx-datasource>
    <jndi-name>OKMDashboardStatsDS</jndi-name>
    <connection-url>jdbc:postgresql://localhost/OKMDashboard</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
    <user-name>postgres</user-name>
    <password>123456</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <idle-timeout-minutes>0</idle-timeout-minutes>
    <track-statements/>
    <!--<security-domain>HsqlDbRealm</security-domain>-->
    <prepared-statement-cache-size>32</prepared-statement-cache-size>
    <metadata>
      <type-mapping>PostgreSQL 8.0</type-mapping>
    </metadata>
    <!--<depends>jboss:service=Postgres,database=OKMDashboard</depends>-->
  </local-tx-datasource>

  <!-- For hsqldb accessed from jboss only, in-process (standalone) mode
<mbean code=\"org.jboss.jdbc.HypersonicDatabase\"
name=\"jboss:service=Hypersonic,database=OKMDashboardStats\">
<attribute name=\"Database\">OKMDashboardStats</attribute>
<attribute name=\"InProcessMode\">true</attribute>
</mbean> -->
</datasources>
When I try to login i get this error:

failed to instantiate shared item state manager: failed to write bundle: cafebabe-cafe-babe-cafe-babecafebabe

Any idea?

Thanks in advance :)

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Fri Apr 09, 2010 7:44 pm
by jllort
normal postgre datasource might be like this:
Code: Select all
<local-tx-datasource>
    <jndi-name>OKMAuthDS</jndi-name>
    <connection-url>jdbc:postgresql://localhost:5432/openkm</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
    <user-name>db_user</user-name>
    <password>db_pass</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <idle-timeout-minutes>0</idle-timeout-minutes>
    <track-statements/>
    <prepared-statement-cache-size>32</prepared-statement-cache-size>
    <metadata>
      <type-mapping>PostgreSQL</type-mapping>
    </metadata>
  </local-tx-datasource>
hope you've copied postgreXXX.jar file into /lib no ?

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Fri Apr 09, 2010 8:04 pm
by mribeiro
Yes I copied... And I already can save documents into PostgreSQL DB... I just can't accomplished the authentication via PostgreSQL.

So I changed my datasource and yet no results... still the same error when I try to login "failed to instantiate shared item state manager: failed to write bundle: cafebabe-cafe-babe-cafe-babecafebabe"
Code: Select all
<?xml version="1.0" encoding="utf-8"?>

<datasources>
  <!-- OpenKM User Activity -->
  <local-tx-datasource>
    <jndi-name>>OKMActivityDS</jndi-name>
    <connection-url>jdbc:postgresql://localhost:5432/OKMActivity</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
    <user-name>postgres</user-name>
    <password>123456</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <idle-timeout-minutes>0</idle-timeout-minutes>
    <track-statements/>
    <prepared-statement-cache-size>32</prepared-statement-cache-size>
    <metadata>
      <type-mapping>PostgreSQL</type-mapping>
    </metadata>
    <!--<depends>jboss:service=Postgres,database=OKMActivity</depends>-->
  </local-tx-datasource>

  <!-- For hsqldb accessed from jboss only, in-process (standalone) mode
<mbean code=\"org.postgresql\"
name=\"jboss:service=Postgres,database=OKMActivity\">
<attribute name=\"Database\">OKMActivity</attribute>
<attribute name=\"InProcessMode\">true</attribute>
</mbean> -->

  <!-- OpenKM User Auth -->
  <local-tx-datasource>
    <jndi-name>OKMAuthDS</jndi-name>
    <connection-url>jdbc:postgresql://localhost:5432/OKMAuthDS</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
    <user-name>postgres</user-name>
    <password>123456</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <idle-timeout-minutes>0</idle-timeout-minutes>
    <track-statements/>
    <!--<security-domain>HsqlDbRealm</security-domain>-->
    <prepared-statement-cache-size>32</prepared-statement-cache-size>
    <metadata>
      <type-mapping>PostgreSQL</type-mapping>
    </metadata>
    <!--<depends>jboss:service=Postgres,database=OKMAuthDS</depends>-->
  </local-tx-datasource>

  <!-- For hsqldb accessed from jboss only, in-process (standalone) mode
<mbean code=\"org.postgresql\"
name=\"jboss:service=Hypersonic,database=OKMAuth\">
<attribute name=\"Database\">OKMAuth</attribute>
<attribute name=\"InProcessMode\">true</attribute>
</mbean> -->

  <!-- OpenKM Dashboard Stats -->
  <local-tx-datasource>
    <jndi-name>OKMDashboardStatsDS</jndi-name>
    <connection-url>jdbc:postgresql://localhost:5432/OKMDashboard</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
    <user-name>postgres</user-name>
    <password>123456</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <idle-timeout-minutes>0</idle-timeout-minutes>
    <track-statements/>
    <!--<security-domain>HsqlDbRealm</security-domain>-->
    <prepared-statement-cache-size>32</prepared-statement-cache-size>
    <metadata>
      <type-mapping>PostgreSQL</type-mapping>
    </metadata>
    <!--<depends>jboss:service=Postgres,database=OKMDashboard</depends>-->
  </local-tx-datasource>

  <!-- For hsqldb accessed from jboss only, in-process (standalone) mode
<mbean code=\"org.jboss.jdbc.HypersonicDatabase\"
name=\"jboss:service=Hypersonic,database=OKMDashboardStats\">
<attribute name=\"Database\">OKMDashboardStats</attribute>
<attribute name=\"InProcessMode\">true</attribute>
</mbean> -->
</datasources>

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Sun Apr 11, 2010 10:15 am
by jllort
About your login-config.xml
<module-option name="principalsQuery">select usr_pass as PASSWD from users where usr_id=? and usr_active='true'</module-option>
<module-option name="rolesQuery">select ur_role as ROLEID, 'Roles' from user_role where ur_user=?</module-option>
<module-option name="hashAlgorithm">md5</module-option>
<module-option name="hashEncoding">hex</module-option>
have you tryed executing these queries
Code: Select all
select usr_pass as PASSWD from users where usr_id=? and usr_active='true'
select ur_role as ROLEID, 'Roles' from user_role where ur_user=?
In mysql for example must be without ' character
Code: Select all
select usr_pass as PASSWD from users where usr_id=? and usr_active=true
The second question is authentication in md5, i hope you've copied okmAdmin and password as is in OpenKM 4.0 default database no ? because password is encrypt not plain text as is defined it this option !!!

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Sun Apr 11, 2010 10:55 am
by mribeiro
Yes I tried and the actually work with or without the ' character...
To get the username and password into the DB, I executed the script auth.ddl so it mus be correct.
But if it was wrong username/password it shouldn't give me that exception, right?

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Mon Apr 12, 2010 3:55 pm
by pavila
mribeiro wrote:So I changed my datasource and yet no results... still the same error when I try to login "failed to instantiate shared item state manager: failed to write bundle: cafebabe-cafe-babe-cafe-babecafebabe"
This error is related to Jackrabbit. There was any problem in the repository creation. You can try to shutdown OpenKM, delete the repository tables and start it again to re-create them.

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Mon Apr 12, 2010 4:01 pm
by mribeiro
But I have to create them before starting OpenKM right?

I mean, the Authentication DB must be replicated in my Postgresql server, right?

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Mon Apr 12, 2010 4:04 pm
by pavila
You should empty the database designed in your repository.xml (delete all tables) because Jackrabbit will try to create them again.

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Mon Apr 12, 2010 5:11 pm
by mribeiro
Ok,

I've emptied the DB, re-created the databases, verified my XML files and I come to this when I try to log into 127.0.0.1/OpenKM , it logs in but a "pop-up" tells me this:
Code: Select all
org.jbpm.JbpmException: couldn't get task instances list for actor 'okmAdmin'
A little more help please? :oops:

Thank you :)

Edit: by the way, guess this is the error code: OKM-022001

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Mon Apr 12, 2010 5:47 pm
by jllort
You have to modify the file WEB-INF/classes/hibernate.cfg.xml located inside the OpenKM.war archive. These are the entries to change:
Code: Select all
<!-- hibernate dialect -->
<property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>

to

<!-- hibernate dialect -->
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
And create the jbpm database, you'll need to execute some .sql take a look here

Re: OpenKM 4 Authentication with Postgresql

PostPosted:Mon Apr 12, 2010 9:42 pm
by mribeiro
Sorry but ... I can't get it... it talks about starter's kit and DBVisualizer... I searched about that stuff and tried to get it but with no success :( :oops:

By the way... the JBPM database insn't just like the OKMWorkflow database?