Skip to content
WordpressAuth module for SimpleSAMLphp
Branch: master
Clone or download
Pull request Compare This branch is even with OliverMaerz:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/Auth/Source
vendor
LICENSE
README.md
default-enable

README.md

WordpressAuth

SimpleSAMLphp module to use Wordpress as a SAML 2.0 Identity Provider. (requires PHP 5 >= 5.3 or PHP 7)

WordpressAuth is SimpleSAMLphp authentication module, that allows to use the Wordpress user database as the authentication source. The code was written for MySQL/MariaDB.

Setup

1 Setup Wordpress on Your Webserver

2 Install SimpleSAMLphp on Your Webserver

Install SimpleSAMLphp and follow the SimpleSAMLphp instructions to set it up as an identity provider (SimpleSAMLphp Identity Provider QuickStart)

3 Add WordpressAuth Module

Create new directory wordpressauth under the modules directory (simplesaml/modules/wordpressauth) and copy the files from this repository to it.

4 Configure Authentication Source

Edit the configuration file for authentication sources simplesaml/config/authsources.php and add:


'wpauthinstance' => array(
    'dsn' => 'mysql:host=localhost;port=3306;dbname=<mysql database name>',
    'username' => '<mysql username>',
    'password' => '<mysql password>',
    'userstable' => 'wp_users',
    'wordpressauth:WordpressAuth'
 ),
 

Replace the placeholders with your MySQL host, username, password and database name.

5 Set Authentication Source in Metadata File

Edit the metadata file for the hosted SAML 2.0 IdP simplesaml/metadata/saml20-idp-hosted.php and set wpauthinstance as your authentication source:


/*
 * Authentication source to use. Must be one that is configured in
 * 'config/authsources.php'.
 */
'auth' => 'wpauthinstance',
 
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.