Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presence subscribe request fails when using JWT auth #3537

Closed
dabslants opened this issue Feb 26, 2021 · 6 comments · Fixed by #3795
Closed

Presence subscribe request fails when using JWT auth #3537

dabslants opened this issue Feb 26, 2021 · 6 comments · Fixed by #3795

Comments

@dabslants
Copy link

Presence subscription request don't get to destination for JWT with users.
Is it not possible to handle presence request manually when using JWT auth?

Tried with sql auth users and it works fine. Only face issue when it's JWT users.

@prefiks
Copy link
Member

prefiks commented Feb 26, 2021

Hello,

I don't think this is the case in general, possibly you have module that blocks that active? I think mod_block_strangers can be configured to do that, do you have it in your config?

@prefiks
Copy link
Member

prefiks commented Feb 26, 2021

Ok, there may be different reason for that. We perform check for user existence before subscription is routed (possibly only when user is offline?), but with jwt we don't have list of users that are registered (they are managed outside ejabberd), which make that check fail.

@dabslants
Copy link
Author

So there's no way out of this.
External auth has methods for this right why not jwt?

@prefiks
Copy link
Member

prefiks commented Feb 26, 2021

With external auth, you we ask external program for that (there is query in extauth protocol that can answer that), but with jwt there is nothing that can tell us for what users tokens were generated. Probably best way for that would be trying to add database to keep info about users that we already seen, and use that to answer this question, but we don't have that yet.

@mremond
Copy link
Member

mremond commented Apr 15, 2021

Related ticket: #3377

Issue would be solved by the same approach: Keep a local store of "known user" that have at least authenticated once on the service.

@Freyskeyd
Copy link
Contributor

Hello,

I've open a PR about this subject and would love to have your input !
The PR is here: #3795

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants