Project

General

Profile

SASLAuth plugin user_jid, account status

Gureen Ryuu
Added over 4 years ago

Hi there! I was wondering where in the SASLAuth can I find the username, password or account status? I tried looking, but I can only find it in the SaslServer ss after the user has been authenticated with the @getAuthorizationID()@, but I was wondering if I could get it before the user is authenticated, as I need it in the cases where the account status isn't 1.


Replies (5)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

To be honest I do not understand what exactly you need/how/why? If you could provide a bit more details it would be easier for me to give you a suggestion.

Generally speaking you do not have any accounts details before authentication because you do not even know the account name, so for which user you would like to have password and status? If you are referring to account status in Tigase's database, then the status is checked during user authentication by Tigase code which user's checks password. So you generally do not need to worry about it.

Added by Gureen Ryuu over 4 years ago

Sorry for the delay. Essentially, what I want is to get the account status after, like you said, the Tigase code checks for the password and finds it's true. Or at least the account's user_id, and then I can do my own query to get the account status.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

In the plugin you can get user's JID from the XMPPResourceConnection object. There is an API for this already. Please note, the account status is more or less Tigase's internal field which is automatically checked at the user authentication time. If you plan to use it for some other purposes I suggest you to have a separate variable/field.

Added by Gureen Ryuu over 4 years ago

I tried session.getjid() but it's giving me null for some reason.. Is there another method I should use?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

You should use session.getJID() or session.getBareJID() instead of @session.getjid()@, because it is not part of the public API. However, in your case, the outcome would be the same. If the method you used returns null or you get an exception from methods I suggested, it means that the session is not yet authenticated and user's JID is not yet known.

    (1-5/5)