From 93f19fcfd354eae1cb3a6286fee45a251642ac96 Mon Sep 17 00:00:00 2001 From: Dominic R Date: Thu, 4 Jun 2026 13:58:16 -0400 Subject: [PATCH] website/integrations: WordPress: cleanup (#22702) * website/integrations: WordPress: cleanup Update the WordPress integration guide to match the current template and current OpenID Connect Generic Client behavior. Agent-thread: https://sdko.org/internal/threads/019e6b52-8487-7133-9c46-7f120cc905dd A7k-product: product A7k-product-repo: 3 Co-authored-by: Agent * Update website/integrations/platforms/wordpress/index.md Signed-off-by: Dewi Roberts --------- Signed-off-by: Dewi Roberts Co-authored-by: Agent Co-authored-by: Dewi Roberts --- .../integrations/platforms/wordpress/index.md | 85 +++++++++---------- 1 file changed, 39 insertions(+), 46 deletions(-) diff --git a/website/integrations/platforms/wordpress/index.md b/website/integrations/platforms/wordpress/index.md index d91ced3721..9f9ea62820 100644 --- a/website/integrations/platforms/wordpress/index.md +++ b/website/integrations/platforms/wordpress/index.md @@ -6,20 +6,20 @@ support_level: community ## What is WordPress? -> WordPress is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database. Features include a plugin architecture and a template system, referred to within WordPress as Themes +> WordPress is an open source publishing platform used to create websites, blogs, and other web content. > -> -- https://en.wikipedia.org/wiki/WordPress +> -- https://wordpress.org/ -:::info -There are many different plugins for WordPress that allow you to set up SSO using different authentication methods. This tutorial uses the "OpenID Connect Generic Client" plugin, version 3.8.5, by Jonathan Daggerhart. This plugin uses OpenID/OAuth2 and is free without paywalls or subscriptions at the time of writing. The plugin is available for free in the WordPress Plugin Directory. +:::info Plugin selection +There are many WordPress plugins that support SSO with different authentication protocols. This guide uses the **OpenID Connect Generic Client** plugin by Jonathan Daggerhart from the WordPress Plugin Directory. ::: ## Preparation The following placeholders are used in this guide: -- `wp.company` is the FQDN of WordPress installation. -- `authentik.company` is the FQDN of authentik installation. +- `wp.company` is the FQDN of the WordPress installation. +- `authentik.company` is the FQDN of the authentik installation. :::info This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application. @@ -29,62 +29,55 @@ This documentation lists only the settings that you need to change from their de To support the integration of WordPress with authentik, you need to create an application/provider pair in authentik. -### Create an application and provider in authentik +### Create an application and provider 1. Log in to authentik as an administrator and open the authentik Admin interface. 2. Navigate to **Applications** > **Applications** and click **New Application** to open the application wizard. - -- **Application**: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings. -- **Choose a Provider type**: select **OAuth2/OpenID Connect** as the provider type. -- **Configure the Provider**: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations. - - Note the **Client ID**, **Client Secret**, and **slug** values because they will be required later. - - Set a `Strict` redirect URI to `https://wp.company/wp-admin/admin-ajax.php?action=openid-connect-authorize`. - - Select any available signing key. - - Under **Advanced protocol settings**, add `offline_access` to the list of selected scopes. -- **Configure Bindings** _(optional)_: you can create a [binding](/docs/add-secure-apps/bindings-overview/) (policy, group, or user) to manage the listing and access to applications on a user's **Application Dashboard** page. + - **Application**: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings. Set the **Launch URL** to `https://wp.company/wp-login.php`. + - **Choose a Provider type**: select **OAuth2/OpenID Connect** as the provider type. + - **Configure the Provider**: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations. + - Note the **Client ID**, **Client Secret**, and application **slug** values because they will be required later. + - Set a `Strict` redirect URI to `https://wp.company/wp-admin/admin-ajax.php?action=openid-connect-authorize`. + - Select any available signing key. + - Under **Advanced protocol settings** > **Scopes**, add `authentik default OAuth Mapping: OpenID 'offline_access'` to the **Selected Scopes** list. + - **Configure Bindings** _(optional)_: you can create a [binding](/docs/add-secure-apps/bindings-overview/) (policy, group, or user) to manage the listing and access to applications on a user's **Application Dashboard** page. 3. Click **Submit** to save the new application and provider. +:::note Redirect URI +If WordPress is installed in a subdirectory, use the **Redirect URI** shown in the OpenID Connect Generic Client plugin's **Notes** section instead of the example redirect URI. +::: + ## WordPress configuration :::info -This guide assumes that you have successfully downloaded and activated the required "OpenID Connect Generic Client" plugin by Jonathan Daggerhart. +This guide assumes that you have installed and activated the **OpenID Connect Generic Client** plugin. ::: -In WordPress, under _Settings_, select _OpenID Connect Client_. +1. Log in to WordPress as an administrator. +2. In the WordPress dashboard, navigate to **Settings** > **OpenID Connect Client**. +3. Expand **Quick Setup: Import from Discovery Document** and set the **Discovery URL** to `https://authentik.company/application/o//.well-known/openid-configuration`. +4. Click **Load Configuration**. +5. Review the populated endpoint settings, then configure the following settings: + - **Client ID**: `` + - **Client Secret Key**: `` + - **OpenID Scope**: `email profile openid offline_access` +6. Click **Save Changes**. -:::info -Only settings that have been modified from default have been listed. +:::note Refresh tokens +The `offline_access` scope lets WordPress use refresh tokens for longer-lived sessions. ::: -- Login Type: OpenID Connect Button on Login (This option displays a button to log in using OpenID as well as local WP login) -- Client ID: Client ID from step 1 -- Client Secret: Client Secret from step 1 -- OpenID Scope: `email profile openid offline_access` -- Login Endpoint URL: `https://authentik.company/application/o/authorize/` -- Userinfo Endpoint URL: `https://authentik.company/application/o/userinfo/` -- Token Validation Endpoint URL: `https://authentik.company/application/o/token/` -- End Session Endpoint URL: `https://authentik.company/application/o/wordpress/end-session/` - -:::info -Make sure to include the _offline_access_ scope to ensure refresh tokens are generated. Otherwise your session will expire and force users to manually log in again. Refer to the [OpenID Connect Core specification](https://openid.net/specs/openid-connect-core-1_0.html#OfflineAccess) for more information. +:::info Optional settings +Review the WordPress plugin's optional settings for your environment. Common settings include **Link Existing Users**, **Create user if does not exist**, and **Enforce Privacy**. ::: -:::info -Review each setting and choose the ones you require for your installation. Examples of popular settings are _Link Existing Users_, _Create user if does not exist_, and _Enforce Privacy_. -::: +## Configuration verification -### Step 3 - authentik +To confirm that authentik is properly configured with WordPress, log out of WordPress and open the WordPress integration from authentik. On the WordPress login page, click **Login with OpenID Connect** and authenticate with authentik. -In authentik, create an application which uses this provider and directly launches WordPress' backend login-screen. Optionally apply access restrictions to the application using policy bindings. +## Resources -- Name: WordPress -- Slug: wordpress -- Provider: WordPress -- Launch URL: https://wp.company/wp-login.php - -## Notes - -:::info -OpenID Connect Generic Client Reference link: https://wordpress.org/plugins/daggerhart-openid-connect-generic/ -::: +- [WordPress.org](https://wordpress.org/) +- [OpenID Connect Generic Client WordPress plugin](https://wordpress.org/plugins/daggerhart-openid-connect-generic/) +- [OpenID Connect Generic Client GitHub repository](https://github.com/oidc-wp/openid-connect-generic)