Title: jamasi's Replies | WordPress.org

---

# jamasi

  [  ](https://wordpress.org/support/users/jamasi/)

 *   [Profile](https://wordpress.org/support/users/jamasi/)
 *   [Topics Started](https://wordpress.org/support/users/jamasi/topics/)
 *   [Replies Created](https://wordpress.org/support/users/jamasi/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/jamasi/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/jamasi/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/jamasi/engagements/)
 *   [Favorites](https://wordpress.org/support/users/jamasi/favorites/)

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[External Login] Support for Redmine password hash](https://wordpress.org/support/topic/support-for-redmine-password-hash/)
 *  Thread Starter [jamasi](https://wordpress.org/support/users/jamasi/)
 * (@jamasi)
 * [6 years ago](https://wordpress.org/support/topic/support-for-redmine-password-hash/#post-12895308)
 * Thanks to your help I got it working.
 * In case sb. else is looking for the correct hook:
 *     ```
       function myExlogHashAuthenticator($password, $hashFromDatabase, $username, $externalUserData) {
         // $salt = exlog_get_option("external_login_option_db_salt");
         $salt = $externalUserData[$db_data["salt"]];
   
         $algorithm = 'sha1';
         $calc1 = hash($algorithm, $password);
         $calc2 = hash($algorithm, $salt . $calc1);
   
         return $hashFromDatabase = $calc2;
       }
       add_filter('exlog_hook_filter_authenticate_hash', 'myExlogHashAuthenticator', 10, 4);
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[External Login] Support for Redmine password hash](https://wordpress.org/support/topic/support-for-redmine-password-hash/)
 *  Thread Starter [jamasi](https://wordpress.org/support/users/jamasi/)
 * (@jamasi)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/support-for-redmine-password-hash/#post-12697454)
 * Sorry to be a nuisance, but how can I debug if the hook is installed? So far 
   I get correct looking data from the connection test, but I cannot login with 
   any user.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[External Login] Support for Redmine password hash](https://wordpress.org/support/topic/support-for-redmine-password-hash/)
 *  Thread Starter [jamasi](https://wordpress.org/support/users/jamasi/)
 * (@jamasi)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/support-for-redmine-password-hash/#post-12697374)
 * After digging into the source of wordpress, I suppose,
 *     ```
       function myExlogHashAuthenticator($password, $hashFromDatabase, $username, $externalUserData) {
       	$user_specific_salt = $externalUserData[$db_data["dbstructure_salt"]];
       	$algorithm = 'sha1';
       	$innerHash = hash($algorithm, $password);
       	$hashCalc = hash($algorithm, $user_specific_salt . $innerHash);
   
           return password_verify($hashCalc, $hashFromDatabase);
       }
       add_filter('exlog_hook_filter_authenticate_hash', 'myExlogHashAuthenticator', 10, 4);
       ```
   
 * should work. Still I wonder what settings to use in the configuration page to
   activate it.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[External Login] Support for Redmine password hash](https://wordpress.org/support/topic/support-for-redmine-password-hash/)
 *  Thread Starter [jamasi](https://wordpress.org/support/users/jamasi/)
 * (@jamasi)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/support-for-redmine-password-hash/#post-12697333)
 * Hi [@tbenyon](https://wordpress.org/support/users/tbenyon/),
 * Thank you for your reply. In the meantime I also fond this hook, but for someone
   who is not into wordpress code that much the documentation could be a little 
   more verbose.
 * I think your code will not work, as the salt is coming from another column of
   the DB table and thus it is per user. I suppose `$externalUserData` might have
   a reference to this, but info on how one could access it would be something I’d
   really like to find in the docs for this hook.
 * Also info on where to put his hook would be needed as putting custom code into
   the functions.php of the theme seems to be discouraged in general.
 * All of this might seem pretty obvious for someone who has been developing wordpress
   plugins for some time, but for a mere user/admin of a wordpress site it’s quite
   some digging through the complexity monster of php code that wordpress is.

Viewing 4 replies - 1 through 4 (of 4 total)