cjscrofani.com
11 min read

Cloudflare Zero Trust for WordPress

WordPressSecurityCloud

A secure WordPress authentication plugin that integrates Cloudflare Zero Trust OIDC (OpenID Connect) into your WordPress login system. Supports both SaaS and Self-hosted applications with enterprise-grade security.

Key Features

Enterprise Security

Leverages Cloudflare's Zero Trust security model with OIDC authentication for robust protection

Flexible Configuration

Supports both SaaS and self-hosted Cloudflare applications with easy setup

Seamless Integration

Works alongside WordPress's native login system without replacing it

Automatic Provisioning

Creates WordPress accounts automatically for authenticated users

Installation

Method 1: WordPress Admin
  1. Download the latest release from GitHub
  2. Navigate to Plugins → Add New → Upload Plugin
  3. Choose the downloaded ZIP file
  4. Click Install Now and then Activate
Method 2: Manual Upload
  1. Extract the ZIP file
  2. Upload the folder to /wp-content/plugins/
  3. Activate the plugin from the WordPress admin panel

Configuration

Cloudflare Setup

1. Create Application

Navigate to Cloudflare Zero Trust → Access → Applications

  • Click Add an Application
  • Choose either SaaS or Self-hosted
  • Configure your application settings
2. Configure OIDC

Redirect URLs:

https://yourdomain.com/wp-admin/admin-ajax.php?action=cloudflare_zt_callback

Save your Client ID and Client Secret for the WordPress configuration

3. WordPress Plugin Settings

Navigate to Settings → Cloudflare ZT Login and configure:

  • Team Domain: your-team.cloudflareaccess.com
  • Client ID: From Cloudflare Application
  • Client Secret: From Cloudflare Application
  • Application Type: SaaS or Self-hosted

Usage

  1. Navigate to your WordPress login page
  2. Click the "Login with Cloudflare" button
  3. Complete authentication via Cloudflare Zero Trust
  4. You'll be redirected back to WordPress and logged in automatically
Account Creation

If this is your first login, the plugin will automatically create a WordPress account using your email address from Cloudflare. New users are assigned the Subscriber role by default.

Requirements

WordPress

5.0+

PHP

7.4+

HTTPS

Required

Support & Resources

This plugin is open source and available under the MIT License