openfire集成自己的用户

  最近在看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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值