|
1 | | -# WordpressAuth |
2 | | -SimpleSAMLphp module to use Wordpress as a SAML 2.0 Identity Provider. (requires PHP 5 >= 5.3 or PHP 7) |
| 1 | +# SimpleSAMLphp WordpressAuth |
3 | 2 |
|
4 | | -WordpressAuth is a SimpleSAMLphp authentication module, that allows to use the Wordpress user database as the authentication source. The code was written for MySQL/MariaDB. |
| 3 | +SimpleSAMLphp module to use Wordpress as a SAML 2.0 Identity Provider. |
5 | 4 |
|
6 | | -## Setup |
| 5 | +WordpressAuth is a SimpleSAMLphp authentication module, that allows to use the Wordpress user database as the authentication source. The code was written for MySQL/MariaDB. |
7 | 6 |
|
8 | | -### 1 Setup Wordpress on Your Webserver |
| 7 | +<img src="https://github.com/disisto/simplesamlphp-wordpressauth/main/img/simplesamlphp-sp-demo-app.gif"> |
9 | 8 |
|
10 | | -### 2 Install SimpleSAMLphp on Your Webserver |
| 9 | +--- |
11 | 10 |
|
12 | | -Install SimpleSAMLphp and follow the SimpleSAMLphp instructions to set it up as an identity provider ([SimpleSAMLphp Identity Provider QuickStart](https://simplesamlphp.org/docs/stable/simplesamlphp-idp)) |
| 11 | +## Content |
13 | 12 |
|
14 | | -### 3 Add WordpressAuth Module |
| 13 | +- [Requirements]( https://github.com/disisto/simplesamlphp-wordpressauth/wiki#requirements) |
| 14 | +- [Installation]( https://github.com/disisto/simplesamlphp-wordpressauth/wiki#installation) |
| 15 | + - [Download]( https://github.com/disisto/simplesamlphp-wordpressauth/wiki#download) |
| 16 | + - [cURL]( https://github.com/disisto/simplesamlphp-wordpressauth/wiki#curl) |
| 17 | + - [wget]( https://github.com/disisto/simplesamlphp-wordpressauth/wiki#wget) |
| 18 | + - [git]( https://github.com/disisto/simplesamlphp-wordpressauth/wiki#git) |
| 19 | + - [Enable Theme in config.php]( https://github.com/disisto/simplesamlphp-wordpressauth/wiki#enable-theme-in-configphp) |
| 20 | +- [Testing]( https://github.com/disisto/simplesamlphp-wordpressauth/wiki#testing) |
15 | 21 |
|
16 | | -Create new directory `wordpressauth` under the `modules` directory (`simplesaml/modules/wordpressauth`) and copy the files from this repository to it. |
| 22 | +--- |
17 | 23 |
|
18 | | -### 4 Configure Authentication Source |
| 24 | +## Requirements |
19 | 25 |
|
20 | | -Edit the configuration file for authentication sources `simplesaml/config/authsources.php` and add: |
| 26 | +- SimpleSAMLphp ```2.0``` |
| 27 | +- WordPress |
| 28 | + - Tested with WordPress ```6.3```* |
| 29 | +- MariaDB/MySQL |
| 30 | + - Tested with MariaDB ```11.0.3```* |
21 | 31 |
|
22 | | -```php |
| 32 | +*Backward compatible. |
23 | 33 |
|
24 | | -'wpauthinstance' => array( |
25 | | - 'dsn' => 'mysql:host=localhost;port=3306;dbname=<mysql database name>', |
26 | | - 'username' => '<mysql username>', |
27 | | - 'password' => '<mysql password>', |
28 | | - 'userstable' => 'wp_users', |
29 | | - 'wordpressauth:WordpressAuth' |
30 | | - ), |
31 | | - |
32 | | -``` |
33 | | -Replace the placeholders with your MySQL host, username, password and database name. |
| 34 | +--- |
34 | 35 |
|
35 | | -### 5 Set Authentication Source in Metadata File |
| 36 | +## Credits |
36 | 37 |
|
37 | | -Edit the metadata file for the hosted SAML 2.0 IdP `simplesaml/metadata/saml20-idp-hosted.php` |
38 | | -and set `wpauthinstance` as your authentication source: |
| 38 | +Big thanks to <a href="https://github.com/OliverMaerz/WordpressAuth">Oliver Maerz</a> for the initial inspiration and <a href="https://github.com/Financial-Edge/simplesamlphp-module-wordpressauth/tree/master">Financial-Edge</a> for the extensions to the original. |
39 | 39 |
|
40 | | -```php |
| 40 | +--- |
41 | 41 |
|
42 | | -/* |
43 | | - * Authentication source to use. Must be one that is configured in |
44 | | - * 'config/authsources.php'. |
45 | | - */ |
46 | | -'auth' => 'wpauthinstance', |
47 | | - |
48 | | -``` |
| 42 | +This project is not affiliated with <a href="https://simplesamlphp.org/">SimpleSAMLphp</a>, <a href="https://wordpress.com/">WordPress</a> and/or <a href="https://mariadb.org/">MariaDB</a>.<br>All mentioned trademarks are the property of their respective owners. |
0 commit comments