论坛首页 入门技术论坛

openfire集成自己的用户

浏览 11148 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-07-08  

  最近在看OPenfire的用户集成管理Custom Database Integration Guide,按照官方的文档资料无论如何也集成不了;我们现有的系统,最后几经周折终于搞定.别的就不多说了具体配置文件如下:

<?xml version="1.0" encoding="UTF-8"?>

<!--
    This file stores bootstrap properties needed by Openfire.
    Property names must be in the format: "prop.name.is.blah=value"
    That will be stored as:
        <prop>
            <name>
                <is>
                    <blah>value</blah>
                </is>
            </name>
        </prop>

    Most properties are stored in the Openfire database. A
 property viewer and editor is included in the admin console.
-->
<!-- root element, all properties must be under this element -->
<jive>
  <adminConsole>
    <!-- Disable either port by setting the value to -1 --> 
    <port>9090</port> 
    <securePort>9091</securePort>
  </adminConsole> 
  <admin>
    <authorizedUsernames>liwei, admin</authorizedUsernames>
  </admin> 
  <locale>zh_CN</locale> 
  <provider>
    <auth>
      <className>org.jivesoftware.openfire.auth.JDBCAuthProvider</className>
    </auth> 
    <user>
      <className>org.jivesoftware.openfire.user.JDBCUserProvider</className>
    </user> 
    <group>
      <className>org.jivesoftware.openfire.group.JDBCGroupProvider</className>
    </group>
  </provider> 
  <jdbcProvider> //需要集成系统的数据库;
    <driver>com.mysql.jdbc.Driver</driver> 
    <connectionString>jdbc:mysql://localhost:3306/test?user=root&amp;password=root</connectionString>
  </jdbcProvider> 
  <jdbcAuthProvider>
    <passwordSQL>SELECT password FROM user_account WHERE Username=?</passwordSQL> 
    <passwordType>plain</passwordType>
  </jdbcAuthProvider> 
  <jdbcUserProvider> //集成用户
    <loadUserSQL>SELECT name,email FROM user_account WHERE Username=?</loadUserSQL> 
    <userCountSQL>SELECT COUNT(*) FROM user_account</userCountSQL> 
    <allUsersSQL>SELECT username FROM user_account</allUsersSQL> 
    <searchSQL>SELECT username FROM user_account WHERE</searchSQL> 
    <usernameField>Username</usernameField> 
    <nameField>name</nameField> 
    <emailField>email</emailField>
  </jdbcUserProvider> //------------
  <connectionProvider>
    <className>org.jivesoftware.database.DefaultConnectionProvider</className>
  </connectionProvider> 
  <database>
    <defaultProvider>
      <driver>com.mysql.jdbc.Driver</driver> 
      <serverURL>jdbc:mysql://localhost:3306/openfire</serverURL> 
      <username>root</username> 
      <password>root</password> 
      <testSQL>select 1</testSQL> 
      <testBeforeUse>true</testBeforeUse> 
      <testAfterUse>true</testAfterUse> 
      <minConnections>5</minConnections> 
      <maxConnections>15</maxConnections> 
      <connectionTimeout>1.0</connectionTimeout>
    </defaultProvider>
  </database> 
  <!-- Fin configuration  --> 
  <setup>true</setup> 
  <log>
    <debug>
      <enabled>true</enabled>
    </debug>
  </log>
</jive>

   发表时间:2008-10-07  
你这xml文件怎么命名啊
你这xml配置文件放在哪啊,是放在openfire的conf目录下?
0 请登录后投票
   发表时间:2008-10-11  
修改原来的配置文件!
0 请登录后投票
   发表时间:2008-10-12  
liwei888 写道

  最近在看OPenfire的用户集成管理Custom Database Integration Guide,按照官方的文档资料无论如何也集成不了;我们现有的系统,最后几经周折终于搞定.别的就不多说了具体配置文件如下:

<?xml version="1.0" encoding="UTF-8"?>

<!--
    This file stores bootstrap properties needed by Openfire.
    Property names must be in the format: "prop.name.is.blah=value"
    That will be stored as:
        <prop>
            <name>
                <is>
                    <blah>value</blah>
                </is>
            </name>
        </prop>

    Most properties are stored in the Openfire database. A
 property viewer and editor is included in the admin console.
-->
<!-- root element, all properties must be under this element -->
<jive>
  <adminConsole>
    <!-- Disable either port by setting the value to -1 --> 
    <port>9090</port> 
    <securePort>9091</securePort>
  </adminConsole> 
  <admin>
    <authorizedUsernames>liwei, admin</authorizedUsernames>
  </admin> 
  <locale>zh_CN</locale> 
  <provider>
    <auth>
      <className>org.jivesoftware.openfire.auth.JDBCAuthProvider</className>
    </auth> 
    <user>
      <className>org.jivesoftware.openfire.user.JDBCUserProvider</className>
    </user> 
    <group>
      <className>org.jivesoftware.openfire.group.JDBCGroupProvider</className>
    </group>
  </provider> 
  <jdbcProvider> //需要集成系统的数据库;
    <driver>com.mysql.jdbc.Driver</driver> 
    <connectionString>jdbc:mysql://localhost:3306/test?user=root&amp;password=root</connectionString>
  </jdbcProvider> 
  <jdbcAuthProvider>
    <passwordSQL>SELECT password FROM user_account WHERE Username=?</passwordSQL> 
    <passwordType>plain</passwordType>
  </jdbcAuthProvider> 
  <jdbcUserProvider> //集成用户
    <loadUserSQL>SELECT name,email FROM user_account WHERE Username=?</loadUserSQL> 
    <userCountSQL>SELECT COUNT(*) FROM user_account</userCountSQL> 
    <allUsersSQL>SELECT username FROM user_account</allUsersSQL> 
    <searchSQL>SELECT username FROM user_account WHERE</searchSQL> 
    <usernameField>Username</usernameField> 
    <nameField>name</nameField> 
    <emailField>email</emailField>
  </jdbcUserProvider> //------------
  <connectionProvider>
    <className>org.jivesoftware.database.DefaultConnectionProvider</className>
  </connectionProvider> 
  <database>
    <defaultProvider>
      <driver>com.mysql.jdbc.Driver</driver> 
      <serverURL>jdbc:mysql://localhost:3306/openfire</serverURL> 
      <username>root</username> 
      <password>root</password> 
      <testSQL>select 1</testSQL> 
      <testBeforeUse>true</testBeforeUse> 
      <testAfterUse>true</testAfterUse> 
      <minConnections>5</minConnections> 
      <maxConnections>15</maxConnections> 
      <connectionTimeout>1.0</connectionTimeout>
    </defaultProvider>
  </database> 
  <!-- Fin configuration  --> 
  <setup>true</setup> 
  <log>
    <debug>
      <enabled>true</enabled>
    </debug>
  </log>
</jive>

 

0 请登录后投票
   发表时间:2008-10-29  
你这个和原教程写的有什么区别啊,除了Username字段大写以外
0 请登录后投票
   发表时间:2008-12-02  
该配置文件怎么不起作用?请指教下,hannove_love@126.com
0 请登录后投票
   发表时间:2009-02-06  
hhren1984 写道
你这个和原教程写的有什么区别啊,除了Username字段大写以外

我看也没啥区别!
0 请登录后投票
   发表时间:2009-07-03  
现在直接改在数据库里面配了,烦死了
0 请登录后投票
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics