I made some poor assumptions about case-sensitivity in relation to the Mastodon accounts table. Changed now to force username comparison to lower during the select statement, and not trust that we're getting lower case from the ejabberd end, either. This should eliminate the issue of some users being unable to authenticate.
|2 months ago|
|.gitignore||8 months ago|
|LICENSE||8 months ago|
|README.md||8 months ago|
|auth-mastodon.py||2 months ago|
The code is derived from ejabberd-auth-mysql and is licensed under the GNU GPLv3.
It is used on Chinwag Social to provide XMPP messaging functionality to every account.
Discussion, questions and/or just saying hi in the Chinwag Social Beergarden MUC (email@example.com) is welcomed!
auth-mastodon.py file and add database connection credentials at the top. Moving this to a config file is next on the TODO list, as this makes updates an awful process. Sorry.
I recommend not using your main Mastodon database user account for this, and instead granting SELECT privileges on the Mastodon accounts and users tables to your ejabberd user instead.
The code here does not attempt any modification to the Mastodon tables at any point, so there’s no reason to give it more than read-only rights.
Then configure ejabberd to use
auth-mastodon.py as an external authentication provider, as described in the ejabberd docs:
auth_method: external extauth_program: "/path/to/auth-mastodon.py"