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

[feature] possibility to authenticate XMPP/Prosody users against Friendica api/json #3104

Closed
AlfredSK opened this issue Jan 23, 2017 · 12 comments

Comments

@AlfredSK
Copy link

There is a possibility to authenticate XMPP users from ejabberd using their Friendica credentials. There is no such option for xmpp/prosody at the moment.

@annando suggested here

A lua script could directly do a http auth against "/api/account/verify_credentials.json"

So, I did some research and found this:

HTTP Authentication using custom JSON protocol:
https://modules.prosody.im/mod_auth_custom_http.html

Maybe it's possible to create an addon for this.

@fabrixxm
Copy link
Collaborator

This should work out of the box against "/api/account/verify_credentials.json" :-)

https://modules.prosody.im/mod_auth_http_async.html

@MrPetovan MrPetovan modified the milestone: 3.6.1 Mar 12, 2018
@annando
Copy link
Collaborator

annando commented Feb 7, 2020

That script that @fabrixxm mentioned worked nearly out of the box. I had to manually deactivate the asynchronous mode by setting the variable local have_async in that script to false, but that is no Friendica issue. In Friendica nothing had to be modified to make it work.

Because of that I'm closing this issue.

@annando annando closed this as completed Feb 7, 2020
@AlfredSK
Copy link
Author

AlfredSK commented Feb 15, 2020

@annando I regularly get errors with this authentication method. It works w/o problems for days and then all of a sudden I can't login anymore. 'Conversations' says wrong username or password.

When this happens I can reproduce that it is related to this fatal PHP error: #7998 (comment)

Any idea what might be wrong?

@Quix0r
Copy link

Quix0r commented Jun 7, 2021

Is it still an issue? I consider switching from ejabberd (I still love it) to prosody).

@Quix0r
Copy link

Quix0r commented Jun 7, 2021

But shouldn't we better authenticate over a local script or socket (e.g. provided by the daemon) instead of this overflow of HTTPS connection which may cause (paid) traffic on some hoster?

@AlfredSK
Copy link
Author

AlfredSK commented Jun 7, 2021

It works perfectly fine.

@fabrixxm
Copy link
Collaborator

fabrixxm commented Jun 7, 2021

But shouldn't we better authenticate over a local script or socket (e.g. provided by the daemon) instead of this overflow of HTTPS connection which may cause (paid) traffic on some hoster?

If it's on same server you should not generate traffic for a call to localhost.
If it's on another server you will generate traffic connecting to a socket anyway.

@annando
Copy link
Collaborator

annando commented Jun 7, 2021

Also the total number of HTTP connects of a single call to the network page will exceed the number of HTTP connects for authentication purposes per year, I guess.

@Quix0r
Copy link

Quix0r commented Jun 7, 2021

Unfortunately localhost doesn't point to my Friendica instance, I have several virtual hosts here. Hmm, I might go like this: http://localhost/friendica/api/foo/bar.json I could map http://localhost/friendica/ to my actual Friendica instance, if that works?

@AlfredSK
Copy link
Author

AlfredSK commented Jun 7, 2021

Why do you want to do that? The authentication requests are probably around 0.00001% of the overall network traffic.

@annando
Copy link
Collaborator

annando commented Jun 7, 2021

I just checked on squeet.me. Yesterday there had been 35 requests for api/account/verify_credentials.json. (I'm using Prosody on that serer). Today there had been 51 requests so far.

The total number of requests yesterday had been 1.262.511, today so far 578.027.

@Quix0r
Copy link

Quix0r commented Jun 7, 2021

Okay, that isn't much to handle.

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

6 participants