Tigase 定制数据库

Tigase Custom Database

我正在尝试集成 Tigase 以使用我的自定义 MySQL 数据库对用户进行身份验证、获取花名册和电子名片。我按照 https://docs.tigase.net/tigase-server/8.0.0/Administration_Guide/html/#customAuthentication 中的描述设置了 "Custom Authentication Connectors" 但是,它似乎只对我已经添加到本地 Tigase 数据库的用户进行身份验证。 Tigase 是否可以在用户成功通过身份验证后自动创建用户?而且,我如何设置 Tigase 以从我的自定义数据库中获取用户名册 and/or vCard?

我已尝试按照 https://docs.tigase.net/tigase-server/8.0.0/Administration_Guide/html/#customAuthentication 中所述设置 "Custom Authentication Connectors",但是,对于仅存在于我的自定义数据库中的用户,它允许登录,但在我尝试登录时会抛出错误创建一个房间或将用户添加到我的名册中 "tigase.db.UserNotFoundException: User does not exist" 和 "WARNING: NotAuthorizedException for packet."

这是我使用的配置,基于 https://docs.tigase.net/tigase-server/8.0.0/Administration_Guide/html/#customAuthentication:

authRepository {
    default () {
        cls = 'tigase.db.jdbc.TigaseCustomAuth'
        'data-source' = 'db-custom'
        'conn-valid-query' = 'select 1'
        'user-account-status-query' = 'select onlineStatus AS account_status from tbl_contacts where id = ?'
        'user-login-query' = "select vUserId AS user_id from tbl_contacts where vUserId = ? AND vPassword = ?"

    }
}

我希望能够将 Tigase 与我的自定义数据库集成,以便它从我的数据库中进行身份验证、获取花名册和 vcard 信息。

你的问题的答案:“Tigase是否可以在用户成功验证后自动创建用户”实际上在链接文档中得到了回答:

To keep user accounts in sync between the authentication database and the main user database you have to add following option to the end of the database connection URL: autoCreateUser=true

目前无法仅通过更改/调整配置从自定义存储库中检索用户数据。

如果您想使用自己的数据库完全管理用户,那么您必须实施 UserRepository interface by yourself (you may take a look at JDBCRepository 实施以了解如何去做)