Word Press Single Sign-On


This was actually intented for a Multi-Network-Multi-Site Word Press installation. But I can work with single separated Word Press installations. You only require that the users have the same username and password among sites.

Single Sign-On between different WP installations

Find this part in your root or parent wp-config.php (/).
[php]
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
[/php]
Add this just below it:
[php]
define(‘COOKIE_DOMAIN’, false);
define(‘ADMIN_COOKIE_PATH’, ‘/’);
define(‘COOKIEPATH’, false);
define(‘SITECOOKIEPATH’, false);
define(‘COOKIEHASH’, md5(‘http://YOUR_ROOT_SITE’));
[/php]
Now copy the entire block from this root file wp-config.php (/) and replace it in the new installation wp-config.php (/blogs/) file.
[php]
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/

define(‘COOKIE_DOMAIN’, false);
define(‘ADMIN_COOKIE_PATH’, ‘/’);
define(‘COOKIEPATH’, false);
define(‘SITECOOKIEPATH’, false);
define(‘COOKIEHASH’, md5(‘http://YOUR_ROOT_SITE’));

define(‘AUTH_KEY’, ‘SOME CRAZY CHARACTERS YOUR INSTALLATION GENERATED’);
define(‘SECURE_AUTH_KEY’, ‘SOME CRAZY CHARACTERS YOUR INSTALLATION GENERATED’);
define(‘LOGGED_IN_KEY’, ‘SOME CRAZY CHARACTERS YOUR INSTALLATION GENERATED’);
define(‘NONCE_KEY’, ‘SOME CRAZY CHARACTERS YOUR INSTALLATION GENERATED’);
define(‘AUTH_SALT’, ‘SOME CRAZY CHARACTERS YOUR INSTALLATION GENERATED’);
define(‘SECURE_AUTH_SALT’, ‘SOME CRAZY CHARACTERS YOUR INSTALLATION GENERATED’);
define(‘LOGGED_IN_SALT’, ‘SOME CRAZY CHARACTERS YOUR INSTALLATION GENERATED’);
define(‘NONCE_SALT’, ‘SOME CRAZY CHARACTERS YOUR INSTALLATION GENERATED’);

/**#@-*/
[/php]
The important part here is that the characters ‘SOME CRAZY CHARACTERS YOUR INSTALLATION GENERATED’ are the same between installations.

I haven’t tryied this on a separate domain installation. But this works great on subdirectories installation.

Hope this works for you as much as it’s been working for me so far.