• Openfire验证机制的修改(整合自定义用户表)


    注意: 按照openfire官方的只是修改openfire.xml是错误的

    可以不修改openfire.xml文档

    步骤:

    正常步骤安装完openfire

    停止openfire服务

    直接在数据库运行:

    UPDATE `openfire`.`ofProperty` SET propValue='org.jivesoftware.openfire.auth.JDBCAuthProvider' WHERE name='provider.auth.className';
    UPDATE `openfire`.`ofProperty` SET propValue='org.jivesoftware.openfire.group.JDBCGroupProvider' WHERE name='provider.group.className';
    UPDATE `openfire`.`ofProperty` SET propValue='org.jivesoftware.openfire.user.JDBCUserProvider' WHERE name='provider.user.className';
        
       
    INSERT INTO `openfire`.`ofProperty` VALUES
         ('jdbcProvider.driver', 'com.mysql.jdbc.Driver'),
         ('jdbcProvider.connectionString', 'jdbc:mysql://localhost:3306/offices?user=root&password=123456'),
         ('admin.authorizedJIDs', 'joe@iamthat,jane@iamthat'),
         ('jdbcAuthProvider.passwordSQL', 'SELECT plainPassword FROM myuser WHERE username=?'),
         ('jdbcAuthProvider.passwordType', 'plain'),
         ('jdbcUserProvider.allUsersSQL', 'SELECT username FROM myuser'),
         ('jdbcUserProvider.loadUserSQL', 'SELECT name,email FROM myuser WHERE username=?'),
         ('jdbcUserProvider.userCountSQL', 'SELECT COUNT(*) FROM myuser'),
         ('jdbcUserProvider.searchSQL', 'SELECT username FROM myuser WHERE'),
         ('jdbcUserProvider.usernameField', 'username'),
         ('jdbcUserProvider.nameField', 'name'),
         ('jdbcUserProvider.emailField', 'email'),
         ('jdbcGroupProvider.allGroupsSQL', 'SELECT groupName FROM mygroup'),
         ('jdbcGroupProvider.descriptionSQL', 'SELECT description FROM mygroup WHERE groupName=?'),
         ('jdbcGroupProvider.groupCountSQL', 'SELECT count(*) FROM mygroup'),
         ('jdbcGroupProvider.loadAdminsSQL', 'SELECT username FROM mygroupuser WHERE groupName=? AND administrator=''Y'''),
         ('jdbcGroupProvider.loadMembersSQL', 'SELECT username FROM mygroupuser WHERE groupName=? AND administrator=''N'''),
         ('jdbcGroupProvider.userGroupsSQL', 'SELECT groupName FROM mygroupuser WHERE username=?');

    重启openfire服务

    你发现 OK了是吧

  • 相关阅读:
    javascript延迟对象
    Fetch-新一代Ajax API
    AJAX笔记
    VR/AR/MR
    为什么Javascript有设计缺陷
    Javascript函数式编程
    vim基本操作
    Git 常用命令(二)
    SSH配置
    C# NPOI导出Excel和EPPlus导出Excel
  • 原文地址:https://www.cnblogs.com/IamThat/p/3094259.html
Copyright © 2020-2023  润新知