Title: Auto Login for Cloudflare Access
Author: johanneswk
Published: <strong>November 30, 2026</strong>
Last modified: November 30, 2026

---

Search plugins

![](https://ps.w.org/auto-login-for-cloudflare-access/assets/icon.svg?rev=3835916)

# Auto Login for Cloudflare Access

 By [johanneswk](https://profiles.wordpress.org/johanneswk/)

[Download](https://downloads.wordpress.org/plugin/auto-login-for-cloudflare-access.1.0.1.zip)

 * [Details](https://wordpress.org/plugins/auto-login-for-cloudflare-access/#description)
 * [Reviews](https://wordpress.org/plugins/auto-login-for-cloudflare-access/#reviews)
 *  [Installation](https://wordpress.org/plugins/auto-login-for-cloudflare-access/#installation)
 * [Development](https://wordpress.org/plugins/auto-login-for-cloudflare-access/#developers)

 [Support](https://wordpress.org/support/plugin/auto-login-for-cloudflare-access/)

## Description

Protect `/wp-admin` (or your whole site) with a Cloudflare Access self-hosted application.
When a visitor has signed in through Access, this plugin verifies the Access token(
JWT) that Cloudflare sends with every request and logs the visitor in to the WordPress
account with the same email address.

 * No passwords: users sign in with any identity provider configured in Cloudflare
   Access.
 * Strict token validation: RS256 signature against Cloudflare’s published keys,
   expiry, audience (AUD) and issuer are all checked.
 * Handles Cloudflare’s signing key rotation automatically.
 * Optional redirect of `wp-login.php` to Cloudflare Access, and logout from Access
   when logging out of WordPress.
 * Built-in debug log on the settings page for troubleshooting.
 * Settings can be locked in `wp-config.php`.

Users are never created: the email address must already belong to a WordPress user.

This plugin is a fork of “Auto Login with Cloudflare” by Kan-Ru Chen, which is no
longer available. When you activate this plugin, the settings of that plugin are
copied over; deactivate and delete the old plugin afterwards.

This plugin is not affiliated with or endorsed by Cloudflare, Inc. Cloudflare and
Cloudflare Access are trademarks of Cloudflare, Inc.

Development happens on [GitHub](https://github.com/johanneswk/auto-login-for-cloudflare-access).

### External services

This plugin connects to Cloudflare Access, a service by Cloudflare, Inc., to verify
that a visitor has signed in.

When a request carries a Cloudflare Access token, the plugin downloads the public
signing keys of your Access team from `https://<your auth domain>/cdn-cgi/access/
certs`. The keys are cached for up to one hour. Only this request is made; no visitor
or site data is sent to Cloudflare by the plugin. Your site is already behind Cloudflare
Access, which handles the sign-in itself.

 * Cloudflare Website and Online Services Terms of Use: https://www.cloudflare.com/
   website-terms/
 * Cloudflare Privacy Policy: https://www.cloudflare.com/privacypolicy/

## Installation

 1. In Cloudflare Zero Trust, create a self-hosted Access application that protects
    at least `/wp-admin` of your site. See the [Cloudflare documentation](https://developers.cloudflare.com/cloudflare-one/applications/configure-apps/self-hosted-apps/).
 2. Install and activate the plugin.
 3. Go to **Settings  Auto Login for Cloudflare Access** and enter:
 4.  * **Auth domain**: your team domain, for example `yourteam.cloudflareaccess.com`.
     * **Application audience (AUD) tag**: found in the Access application’s overview.
 5. Optionally enable **Redirect login page** so `wp-login.php` sends users through
    Cloudflare Access.

Instead of using the settings page you can define the values in `wp-config.php`.
Defined values take precedence and cannot be changed from the admin:

    ```
    define('WP_CF_ACCESS_AUTH_DOMAIN', 'yourteam.cloudflareaccess.com');
    define('WP_CF_ACCESS_JWT_AUD', 'your-aud-tag');
    define('WP_CF_ACCESS_REDIRECT_LOGIN', true);
    define('WP_CF_ACCESS_DEBUG_MODE', false);
    ```

## FAQ

### A user is not logged in. How do I find out why?

Enable debug mode on the settings page and reload a protected page. Every step of
the validation is shown in the debug log. Authentication failures are also written
to the PHP error log.

### How do I send the WordPress login page to Cloudflare Access?

Enable **Redirect login page**. Visitors to `wp-login.php` are redirected to `/wp-
admin/`, where Cloudflare Access asks them to sign in. Make sure your Access application
protects `/wp-admin`, otherwise this causes a redirect loop.

### Is my server still reachable without Cloudflare?

That depends on your hosting. Tokens are always verified, but for the best protection
only allow traffic to your server from Cloudflare, for example with Cloudflare Tunnel
or a firewall allowlist.

### Does the plugin create WordPress users?

No. The email address from Cloudflare Access must match an existing user.

### What data does the debug log store?

Up to 100 recent messages, including email addresses, user names and IP addresses,
for at most one week. Clear it with the **Clear Debug Logs** button. Everything 
is removed when the plugin is deleted.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Auto Login for Cloudflare Access” is open source software. The following people
have contributed to this plugin.

Contributors

 *   [ johanneswk ](https://profiles.wordpress.org/johanneswk/)

[Translate “Auto Login for Cloudflare Access” into your language.](https://translate.wordpress.org/projects/wp-plugins/auto-login-for-cloudflare-access)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/auto-login-for-cloudflare-access/),
check out the [SVN repository](https://plugins.svn.wordpress.org/auto-login-for-cloudflare-access/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/auto-login-for-cloudflare-access/)
by [RSS](https://plugins.trac.wordpress.org/log/auto-login-for-cloudflare-access/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.1

 * Maintenance: new plugin icon and automated release process. No functional changes.

#### 1.0.0

 * First release in the WordPress.org directory, continuing “Auto Login with Cloudflare”
   by Kan-Ru Chen.
 * Settings of the original plugin are copied over on activation.
 * Strict Cloudflare Access token validation with firebase/php-jwt 7.2.2: RS256 
   signature, required expiry, audience, issuer and email.
 * Automatic handling of Cloudflare signing key rotation and outages.
 * Validated settings, debug log on the settings page, and full cleanup when the
   plugin is deleted.

## Meta

 *  Version **1.0.1**
 *  Last updated **9 hours ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.3 or higher **
 *  Tested up to **7.1.5**
 *  PHP version ** 8.0 or higher **
 * Tags
 * [jwt](https://wordpress.org/plugins/tags/jwt/)[login](https://wordpress.org/plugins/tags/login/)
   [sso](https://wordpress.org/plugins/tags/sso/)[zero trust](https://wordpress.org/plugins/tags/zero-trust/)
 *  [Advanced View](https://wordpress.org/plugins/auto-login-for-cloudflare-access/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/auto-login-for-cloudflare-access/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/auto-login-for-cloudflare-access/reviews/)

## Contributors

 *   [ johanneswk ](https://profiles.wordpress.org/johanneswk/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/auto-login-for-cloudflare-access/)