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

How to get the client IP for authentication purposes in an external auth script? #4217

Open
joe-average-user opened this issue May 7, 2024 · 4 comments

Comments

@joe-average-user
Copy link

Hello all,

for lack of a better way of communication I try this one :-)
I'd like to make an external authentication script like those published on the website. But reading the ones already there I see no option to get the client ip in such a script. Can anyone capable please elaborate on how to do that?
Thank you!

Regards

@weiss
Copy link
Member

weiss commented May 7, 2024

for lack of a better way of communication I try this one :-)

There's the [email protected] room, for example.

I'd like to make an external authentication script like those published on the website. But reading the ones already there I see no option to get the client ip in such a script. Can anyone capable please elaborate on how to do that?

This would require an ejabberd patch for passing the IP address to the authentication script. I need that myself and could give you my local commit if you happen to build ejabberd from source.

@joe-average-user
Copy link
Author

joe-average-user commented May 7, 2024

Hello,

thank you for your immediate reaction. It would be great to have your commit! And please add a short info on what version to apply best, as I am doing this on a productive platform. I am building it on arch linux.
Thanks again!

--
Regards

@mremond
Copy link
Member

mremond commented May 14, 2024

Hello @weiss,

Do you think we could have a patch that is backward compliant with older version of the script for people that use it in production already ?

@weiss
Copy link
Member

weiss commented May 14, 2024

It would be great to have your commit!

It's currently used with a very old ejabberd version and it's based on other local commits, but I had a quick go at rebasing it onto ejabberd 24.02:

https://github.com/weiss/ejabberd/tree/feature/extauth-ip

I did not yet get around to testing this version (beyond "it compiles"), sorry.

Do you think we could have a patch that is backward compliant with older version of the script

I think this would require a new ejabberd option to specify the extauth format/version.

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

No branches or pull requests

3 participants