• Authentication Error

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #3805  by hayasi
 
Hi
everybody
The following MySQL dataSource configuration
When I tried okmAdmin, admin login. show me “Authentication Error”
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:mysql://127.0.0.1:3306/OKMActivity</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password></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>mySQL</type-mapping>
    </metadata>
  <!--  <depends>jboss:service=Hypersonic,database=OKMActivity</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=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:mysql://127.0.0.1:3306/OKMAuth</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password></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>mySQL</type-mapping>
    </metadata>
   <!-- <depends>jboss:service=Hypersonic,database=OKMAuth</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=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:mysql://127.0.0.1:3306/OKMDashboardStats</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password></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>mySQL</type-mapping>
    </metadata>
   <!-- <depends>jboss:service=Hypersonic,database=OKMDashboardStats</depends>-->
  </local-tx-datasource>


   <local-tx-datasource>
    <jndi-name>OKMWorkflowDS</jndi-name>
    <connection-url>jdbc:mysql://127.0.0.1:3306/OKMWorkflow</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password></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>mySQL</type-mapping>
    </metadata>
    <!--<depends>jboss:service=Hypersonic,database=OKMWorkflow</depends>-->
  </local-tx-datasource>


</datasources>
who can help to solve?
thanks a lot's of you :D
 #3814  by jllort
 
is in this databases some table created ? if not you must create it
take a look at login-config.xml to look about which query is executed to get users and roles.
take a look at hypersonic database ( connect with it ) to take a look existing tables in hypersonic that must be created in your mysql
 #3817  by hayasi
 
jllort wrote:is in this databases some table created ? if not you must create it
take a look at login-config.xml to look about which query is executed to get users and roles.
take a look at hypersonic database ( connect with it ) to take a look existing tables in hypersonic that must be created in your mysql
Hi
jllort
about DB,i have already created 4 databases,okmactivity,okmauth,okmdashboardstats,okmworkflowds.
about TABLE, i have already created required tables.and the data also import

and I think that the login-config.xml file configuration mysql and hypersonic no difference.so , I do not have to change it.

Thank you
 #3869  by jllort
 
Execute the query you're executing in login-config.xml, take a look at roles name you get in this case, it must be UserRole assigned to user.

Code: Select all
  <local-tx-datasource>
    <jndi-name>OKMActivityDS</jndi-name>
    <connection-url>jdbc:mysql://localhost:3306/openkm</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password>xxx</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>mySQL</type-mapping>
    </metadata>
  </local-tx-datasource>
Code: Select all
#
# Generic auth database definition
#
CREATE TABLE users(usr_id VARCHAR(32), usr_name VARCHAR(64), usr_pass VARCHAR(32) NOT NULL, usr_email VARCHAR(32) NOT NULL, usr_active BOOLEAN, PRIMARY KEY(usr_id));
CREATE TABLE roles(rol_id VARCHAR(32), PRIMARY KEY(rol_id));
CREATE TABLE user_role(ur_user VARCHAR(32), ur_role VARCHAR(32), PRIMARY KEY(ur_user, ur_role));
CREATE TABLE mail_accounts(ma_id INTEGER AUTO_INCREMENT, ma_user VARCHAR(32), ma_mhost VARCHAR(32), ma_muser VARCHAR(32), ma_mpass VARCHAR(32), ma_mfolder VARCHAR(32), ma_active BOOLEAN, PRIMARY KEY(ma_id));
CREATE TABLE twitter_accounts(ta_id INTEGER AUTO_INCREMENT, ta_user VARCHAR(32), ta_tuser VARCHAR(32), ta_active BOOLEAN, PRIMARY KEY(ta_id));
 
# INSERT DEFAULT USER / ROLES
INSERT INTO users (usr_id, usr_name, usr_pass, usr_email, usr_active) VALUES ('okmAdmin', 'Administrator', '21232f297a57a5a743894a0e4a801fc3', '', true);
INSERT INTO roles (rol_id) VALUES ('AdminRole');
INSERT INTO roles (rol_id) VALUES ('UserRole');
INSERT INTO user_role (ur_user, ur_role) VALUES ('okmAdmin', 'AdminRole');

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.