Skip to content
daggerhart edited this page Nov 20, 2026 · 9 revisions

A simple client that provides SSO or opt-in authentication against a generic OAuth2 Server implementation.

Description

This plugin allows to authenticate users against OpenID Connect OAuth2 API with Authorization Code Flow. Once installed, it can be configured to automatically authenticate users (SSO), or provide a "Login with OpenID Connect" button on the login form. After consent has been obtained, an existing user is automatically logged into WordPress, while new users are created in WordPress database.

Quick Start

Get up and running with OpenID Connect in 5 minutes:

1. Install the Plugin

Install via WordPress.org plugin repository (search for "OpenID Connect Generic Client") or manually upload to /wp-content/plugins/. A copy downloaded from GitHub needs one extra step; see Installing from Source.

2. Gather IDP Information

From your Identity Provider (Azure AD, Google, Keycloak, etc.), you'll need:

  • Client ID - Your application identifier
  • Client Secret - Your application secret key
  • Authorization Endpoint - Login URL
  • Token Endpoint - Token validation URL
  • Userinfo Endpoint - User information URL

Most IDPs provide these in their OpenID Connect discovery document at https://your-idp.com/.well-known/openid-configuration.

3. Configure Basic Settings

  1. Go to Settings > OpenID Connect Client in WordPress admin
  2. Enter your IDP information:
    • Client ID
    • Client Secret
    • Scope (typically: openid email profile)
    • Login Endpoint URL
    • Userinfo Endpoint URL
    • Token Validation Endpoint URL
  3. Choose Login Type:
    • Button - Adds "Login with OpenID Connect" button to wp-login.php
    • Auto Login (SSO) - Automatically redirects to IDP

4. Test Authentication

  1. Log out of WordPress
  2. Visit your login page
  3. Click the OpenID Connect button (or get auto-redirected)
  4. Authenticate with your IDP
  5. You should be logged into WordPress

Next Steps


I Want To...

🔧 Configure the Plugin (WordPress Admins)

You're a WordPress administrator setting up authentication.

Start here:

Popular IDP guides:

🎨 Customize & Extend (Site Developers)

You're a developer extending the plugin for custom requirements.

Start here:

Common customizations:

  • Control who can log in (domain restrictions, role-based access)
  • Sync user data with external systems (CRM, HR, analytics)
  • Custom role mapping from IDP claims
  • Enhanced logging and audit trails
  • Session management and security controls

Other resources:

  • Shortcodes - Display user information and login buttons
  • FAQ - Frequently asked questions

Installation

WordPress.org Plugin Repository

  1. Go to "Plugins" in your WordPress dashboard.
  2. Click on "Add New".
  3. Search for the plugin using "OpenID Connect Generic Client".
  4. Click the "Install Now" button.
  5. "Activate" the plugin.

Manual

  1. Download the plugin from WordPress.org
  2. Upload to the /wp-content/plugins/ directory
  3. Activate the plugin
  4. Visit Settings > OpenID Connect Client and configure to meet your needs

Installing from Source

The GitHub repository and its "Download ZIP" button contain the source code, without the vendor/ folder the plugin needs. Activating that copy fails with a fatal error about vendor/autoload.php.

To run the plugin from source, install its dependencies with Composer in the plugin folder before activating it:

cd wp-content/plugins/openid-connect-generic
composer install --no-dev

I Want To...

🔧 Configure the Plugin

🎨 Customize & Extend


Documentation

Clone this wiki locally