Documentation
Introduction

Use this guide to enable 2-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
  • Registration Methods – the 2-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 to the Email 2 Property if it is not already contained somewhere else

Distinct configuration steps are required in the Profile Fields section if user provisioning is required

See User Provisioning Configuration Steps below for more information

Click Save once the configurations have been completed and before leaving the Data page to avoid losing changes

Workflow

 

2. In the SAML 2.0 Service Provider section, 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

Click Save once the configurations have been completed and before leaving the Workflow page to avoid losing changes

Post Authentication

 

3. Select SAML 2.0 (SP Initiated) Assertion Page from the Authenticated User Redirect dropdown in the Post Authentication tab in the Web Admin

4. 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)

5. A customized post authentication page can be uploaded, but it is not required

User ID Mapping

6. Select the SecureAuth IdP Property that corresponds to the directory field that contains the WordPress ID (Email 2)

7. 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

8. Select False from the Encode to Base64 dropdown

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

 

9. 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

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

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)

Click Save once the configurations have been completed and before leaving the Post Authentication page to avoid losing changes

Forms Auth / SSO Token

 

15. Click View and Configure FormsAuth keys / SSO token to configure the token/cookie settings and to configure this realm for SSO

These are optional configurations


 To configure this realm's token/cookie settings, follow these steps:
Forms Authentication


1. If SSL is required to view the token, select True from the Require SSL dropdown

2. Choose whether SecureAuth IdP will deliver the token in a cookie to the user's browser or device:

  • UseCookies enables SecureAuth IdP to always deliver a cookie
  • UseUri disables SecureAuth IdP to deliver a cookie, and instead deliver the token in a query string
  • AutoDetect enables SecureAuth IdP to deliver a cookie if the user's settings allow it
  • UseDeviceProfile enables SecureAuth IdP to deliver a cookie if the browser's settings allow it, no matter the user's settings

3. Set the Sliding Expiration to True if the cookie remains valid as long as the user is interacting with the page

4. Set the Timeout length to determine for how many minutes a cookie is valid

No configuration is required for the Name, Login URL, or Domain fields

Machine Key

5. No changes are required in the Validation field, unless the default value does not match the company's requirement

If a different value is required, select it from the dropdown

6. No changes are required in the Decryption field, unless the default value does not match the company's requirement

If a different value is required, select it from the dropdown

No configuration is required for the Validation Key or Decryption Key fields

Authentication Cookies

 

7. Enable the cookie to be Persistent by selecting True - Expires after Timeout from the dropdown

Selecting False - Session Cookie enables the cookie to be valid as long as the session is open, and will expire once the browser is closed or the session expires

No configuration is required for the Pre-Auth Cookie, Post-Auth Cookie, or the Clean Up Pre-Auth Cookie fields

Click Save once the configurations have been completed and before leaving the Forms Auth / SSO Token page to avoid losing changes

To configure this realm for SSO, refer to SecureAuth IdP Single Sign-on Configuration

To configure this realm for Windows Desktop SSO, refer to Windows Desktop SSO Configuration Guide

User Provisioning Configuration Steps
 If User Provisioning is Requested

Follow these configuration steps in lieu of or in addition to the SecureAuth IdP Configuration Steps noted above

Data

 

1. In the Profile Fields section, map the directory field that contains the user's first name to the SecureAuth IdP First Name Property, e.g. givenName

2. Map the directory field that contains the user's last name to the SecureAuth IdP Last Name Property, e.g. sn

3. Map the directory field that contains the user's email address to the SecureAuth IdP Email 1 Property, e.g. mail

These steps are in lieu of step 1

Click Save once the configurations have been completed and before leaving the Data page to avoid losing changes

Post Authentication

 

4. In the User ID Mapping section, select Authenticated User ID from the User ID Mapping dropdown

This step is in lieu of step 6

SAML Attributes / WS Federation

 

5. Set the Name of Attribute 1 to uid

6. Select Authenticated User ID from the Value dropdown

7. Set the Name of Attribute 2 to sn

8. Select Last Name from the Value dropdown

9. Set the Name of Attribute 3 to givenName

10. Select First Name from the Value dropdown

These steps are in addition to the SecureAuth IdP Configuration Steps and the steps listed above

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 9), 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

 Example Image

SimpleSAMLphp Authentication Options

 

6. Log into the WordPress admin console, and select simpleSAMLphp Authentication from the Settings menu

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