سؤال

Is it possible to use Bcrypt as a password type for openfire external authentication? The bcrypt with $2y$ prefix is the encryption of my existing userbase.

I am trying to implement XMPP as an alternative to my current chat system.

<jdbcAuthProvider>
  <passwordSQL>SELECT password FROM user_account WHERE username=?</passwordSQL>
  <passwordType>md5</passwordType>
</jdbcAuthProvider>
هل كانت مفيدة؟

المحلول

I ended up getting the source code and modifying the auth class. Coded in Java.
I suggest extending jdbcAuthProvider or just the defaultAuthProvider. It is pretty straight forward.

This documentation is divided into three sections:

  1. Source, get the Openfire source code.
  2. Setup, how to setup your environment for Openfire development.
  3. Build tasks, tasks that can be performed using the build program.

You can then get the bCrypt for Java at mindrot.org.

if (BCrypt.checkpw(user_provided_password, hashed_password_from_db))
    System.out.println("It matches");
else
    System.out.println("It does not match");
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top