On Thu, 03/22/12 3:24 AM, Tomasz Sterna wrote:
BTW, this is intentionally hidden feature, but you're able to define DB
queries for RDBMS authreg plugins in c2s.xml config file, without
modyfing jabberd2 code.

Just define
authreg.mysql.sql.create
authreg.mysql.sql.select
authreg.mysql.sql.setpassword
authreg.mysql.sql.delete

Alas my plugin does more than execute a SQL query. I had to build logic that strips off the domain portion of the username if its lavabit.com but leave it intact for everyone else. Then I run the cleansed username and plain text password through SHA 512. The SQL query then searches the database for a match. If that fails, I look for a matching email address in the mailboxes table and use that to map back to a username so I can repeat the process with the correct username...

I also added logic to detect and handle situations where the credentials are valid, but the account is locked. Or if the account is configured to require SSL for access, I'll check the connection status and enforce that rule on XMPP connections.

There are a few more things its doing, but I'd have to check the code to get the list accurate. :)



Reply via email to