Last Updated: February 25, 2016
·
612
· halilim

Migrate Wordpress user passwords to Sentry

Add this to somewhere in your code (e.g. app/start/global.php in a Laravel 4 app) and you are all set (note that Sentry must be configured to use the native hasher, which is the default):

Cartalyst\Sentry\Hashing\NativeHasher::addFallback(
    "wp",
    function ($password, $hash) {
        return MikeMcLin\WpPassword\WpPassword::check($password, $hash);
    }
);

This will allow you to:

  1. Use your old Wordpress passwords in your new Sentry app without resetting them,
  2. Gradually upgrade passwords.

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

WordPress sites collect scripts from themes, plugins, and tag managers. A compromised plugin update can add a skimmer to every page without a change in your own templates.

Security insights from Cside