WordPress (SP-initiated) Integration Guide
Introduction
Use this guide to enable Multi-Factor Authentication and Single Sign-on (SSO) access via SAML to WordPress.
Prerequisites
1. Have a WordPress account
2. Download and install the SimpleSAMLphp Application (see configuration steps below)
3. Create a New Realm for the WordPress integration in the SecureAuth IdP Web Admin
4. Configure the following tabs in the Web Admin before configuring the Post Authentication tab:
Overview – the description of the realm and SMTP connections must be defined
Data – an enterprise directory must be integrated with SecureAuth IdP
Workflow – the way in which users will access this application must be defined
Multi-Factor Methods – the Multi-Factor Authentication methods that will be used to access this page (if any) must be defined
SecureAuth IdP Configuration Steps
Data
1. In the Profile Fields section, map the directory field that contains the user's WordPress ID to the SecureAuth IdP Property
For example, add the WordPress ID Field to the Email 2 Property if it is not already contained somewhere else
Note
Distinct configuration steps are required in the Profile Fields section if user provisioning is required
See User Provisioning Configuration Steps below for more information
Warning
Click Save once the configurations have been completed and before leaving the Data page to avoid losing changes
Post Authentication
2. Select SAML 2.0 (SP Initiated) Assertion Page from the Authenticated User Redirect dropdown in the Post Authentication tab in the Web Admin
3. An unalterable URL will be auto-populated in the Redirect To field, which will append to the domain name and realm number in the address bar (Authorized/SAML20SPInit.aspx)
4. A customized post authentication page can be uploaded, but it is not required
User ID Mapping
5. Select the SecureAuth IdP Property that corresponds to the directory field that contains the WordPress ID (Email 2)
6. Select urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified from the Name ID Format dropdown (default)
Select a different option if WordPress requires it, which the Service Provider (SP) will provide
7. Select False from the Encode to Base64 dropdown
Note
Distinct configuration steps are required in the User ID Mapping section if user provisioning is required
See User Provisioning Configuration Steps below for more information
SAML Assertion / WS Federation
8. Set the WSFed/SAML Issuer to a Unique Name that will be shared with WordPress
The WSFed/SAML Issuer must match exactly on the SecureAuth IdP side and the WordPress side
9. Provide the SP Start URL to enable SSO and to redirect users appropriately to access WordPress
For example, the SP Start URL would be https://www.<company>.com/wp-login.php
10. Set the SAML Offset Minutes to make up for time differences between devices
11. Set the SAML Valid Hours to limit for how long the SAML assertion is valid
Note
No configuration is required for the WSFed Reply To/SAML Target URL, SAML Consumer URL, SAML Recipient, or SAML Audience fields
12. Leave the Signing Cert Serial Number as the default value, unless there is a third-party certificate being used for the SAML assertion
If using a third-party certificate, click Select Certificate and choose the appropriate certificate
13. Download the Assertion Signing Certificate, which will be used in the WordPress Configuration Steps
14. Provide the Domain in order to Download the Metadata File to send to WordPress (if required)
Warning
Click Save once the configurations have been completed and before leaving the Post Authentication page to avoid losing changes
Forms Auth / SSO Token
Optionally, in the Forms Auth / SSO Token section, click the View and Configure FormsAuth keys/SSO token link to configure the token/cookie settings and configure this realm for SSO.
User Provisioning Configuration Steps
SimpleSAMLphp Application Configuration Steps
1. Download the SimpleSAMLphp Application
2. Install it as an application served by Apache (Linux server) (more information)
authsources.php
Full instructions can be found here
3. Upload the Assertion Signing Certificate from the SecureAuth IdP Web Admin (step 13) to the SimpleSAMLphp certificate folder, /var/simplesaml/cert
4. Open the authsources.php file (/var/simplesaml/config), and make the appropriate changes to the file to reflect the pictured code:
Set saml to SP, e.g. 'saml:SP'
Provide the file of the Assertion Signing Certificate, e.g. 'certificate'=>'SAIdPcert.cer'
Set the Entity ID to the same Unique Name established in the WSFed/SAML Issuer field in the SecureAuth IdP Web Admin (step 8), e.g. 'entityID' =>'UniqueName'
Set IdP to the same value as that of the Entity ID, e.g. 'idp' => 'UniqueName'
Set discoURL to NULL, e.g. 'discoURL' => NULL
saml20-idp-remote.php
5. Open the saml20-idp-remote.php file (/var/simplesaml/metadata), and make the appropriate changes to the file to reflect the pictured code:
Provide a name for the Metadata, such as the Fully Qualified Domain Name (FQDN) of the SecureAuth IdP appliance e.g. $metadata['https://secureauth.company.com']
Set the SingleSignOnService to the FQDN of the SecureAuth IdP appliance, followed by the SecureAuth IdP WordPress-integrated realm, e.g. 'SingleSignOnService' => 'https://secureauth.company.com/secureauth1/secureauth.aspx'
Set the SingleLogoutService to the FQDN of the SecureAuth IdP appliance, followed by the SecureAuth IdP WordPress-integrated realm, e.g. 'SingleLogoutService' => 'https://secureauth.company.com/secureauth1/secureauth.aspx'
Provide the Certificate Fingerprint of the Assertion Signing Certificate, e.g. 'certFingerprint' => '1A:2B:3C:4D:5E:6F:7G:8H:9I:1A:2B:3C:4D:5E:6F:7G:8H:9I:1A:2B'
WordPress Configuration Steps
1. Download the SimpleSAMLphp-authentication.php plugin in WordPress
2. Drop it into WordPress's plugins folder (/var/www/wordpress/wp-content/plugins)
SimpleSAMLphp Authentication Plugin
3. Open the plugin and search for wp_login, as shown in the image
4. Replace wp_login with wp_signon
5. Save and exit
SimpleSAMLphp Authentication Options
6. Log into the WordPress admin console, and select simpleSAMLphp Authentication from the Settings menu
Note
See User Provisioning Configuration Steps in the SecureAuth IdP Configuration Steps for additional configuration
7. Check Automatically register new users if user provisioning is requested
8. Set the Path to simpleSAMLphp to /var/simplesaml
9. Set the Authentication source to the name of the authentication source (default-sp is default)
10. Set the Attribute to be used as username to uid
11. Set the Attribute to be used as First Name to givenName
12. Set the Attribute to be used as Last Name to sn
13. Set the Attribute to be used as E-mail to mail
14. Click Update Options