Project

General

Profile

Auto user and roster management

Wenjun Che
Added over 5 years ago

Hello

I am new to Tigase and just got my custom authentication plugin working. Now I have 2 questions:

  1. My custom authentication code (implements AuthRepository) checks users in an external server, but I still need Tigase to manage rosters. I believe the users need to exist in Tigase database as well. After authenticating an user, how do I check if the user exists in Tigase DB, and create it if it is missing.

  2. One of our requirements is that: when userA sends userB a friend request, we need the server to automatically approve the request so both users are in each other roster. Is this possible?

I am running the Server version: 5.1.5

Thanks for your help


Replies (5)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Wenjun Che wrote:

Hello

I am new to Tigase and just got my custom authentication plugin working. Now I have 2 questions:

  1. My custom authentication code (implements AuthRepository) checks users in an external server, but I still need Tigase to manage rosters. I believe the users need to exist in Tigase database as well. After authenticating an user, how do I check if the user exists in Tigase DB, and create it if it is missing.

You do not need to do so. Tigase can add user automatically to own database if necessary. You need to append autoCreateUser=true property to DB connection string.

For more details, please read the online documentation: http://www.tigase.org/content/custom-authentication-connectors

  1. One of our requirements is that: when userA sends userB a friend request, we need the server to automatically approve the request so both users are in each other roster. Is this possible?

I am running the Server version: 5.1.5

This is not available at the moment. We do have a request for the functionality but we do not have ETA for this yet. It needs a custom presence plugin for this to work.

Added by Wenjun Che over 5 years ago

Hello Artur

Thank you for the reply. I just tried autoCreateUser and it works great.

I have been reading about building plugins and browsing the source code, which is a slow process. It'd be great if you can point me to some sample code/articles for building presence plugin.

Thanks again

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

There is online development guide available: http://www.tigase.org/devel-guide

Plus JavaDoc where it exists and the Tigase source code as an example. I think a working code is the best example of how to do stuff.

Added by Wenjun Che over 5 years ago

Hello Artur

I have been looking at tigase.xmpp.impl.Presence. Is this right spot to start?

If I create my own plugin, does mine replace tigase.xmpp.impl.Presence entirely? Ideally, I don't want to touch tigase.xmpp.impl.Presence at all. Is there any way to get notified after tigase.xmpp.impl.Presence processes new subscribe messages and perform the additional steps?

Thanks

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Yes, this is the place. Just a small warning, the Presence plugin and presence specification in XMPP is probably the most complex element of the whole XMPP protocol. Especially if it comes to the subscription workflow. So it might be hard to understand at first. Once you get this, the rest of XMPP will be piece of cake.

By the way, please read the XMPP spec first.

    (1-5/5)