0

I am trying to integrate Tigase to use my custom MySQL database to authenticate users, gets rosters and vCards. I setup the "Custom Authentication Connectors" as described at https://docs.tigase.net/tigase-server/8.0.0/Administration_Guide/html/#customAuthentication however, it only seems to authenticate users I've already added to the local Tigase database. Is it possible for Tigase to automatically create the user when the user has successfully authenticated? And, how can I setup Tigase to get the user's roster and/or vCard from my custom database?

I've tried setting up the "Custom Authentication Connectors" as described at https://docs.tigase.net/tigase-server/8.0.0/Administration_Guide/html/#customAuthentication, however, for users that only exists in my custom database, it allows login, but throws an error when I try to create a room or add a user to my roster as "tigase.db.UserNotFoundException: User does not exist" and "WARNING: NotAuthorizedException for packet."

Here is the config I am using based on 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 = ?"

    }
}

I expect to be able to integrate Tigase with my custom database so that it authenticates, gets roster and vcard information from my database.

4

1 回答 1

0

您的问题的答案:“当用户成功通过身份验证时,Tigase 是否可以自动创建用户”实际上在链接文档中得到了回答:

要使用户帐户在身份验证数据库和主用户数据库之间保持同步,您必须在数据库连接 URL 的末尾添加以下选项:autoCreateUser=true

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

如果您想使用自己的数据库完全管理用户,那么您必须自己实现UserRepository接口(您可以查看JDBCRepository实现以了解如何去做)

于 2019-08-30T16:57:27.140 回答