kanru / auto-login-with-cloudflare Goto Github PK
View Code? Open in Web Editor NEWSuper simple way to allow a single sign on to your Wordpress site when using Cloudflare Access.
License: GNU General Public License v2.0
Super simple way to allow a single sign on to your Wordpress site when using Cloudflare Access.
License: GNU General Public License v2.0
=== Auto Login with Cloudflare === Contributors: kanru Tags: cloudflare,jwt,login Donate link: https://www.buymeacoffee.com/kanru Requires at least: 5.0 Tested up to: 6.1.1 Requires PHP: 5.3 Stable tag: 1.1.4 License: GPL-2.0+ License URI: http://www.gnu.org/licenses/gpl-2.0.txt Super simple way to allow a single sign on to your Wordpress site when using Cloudflare Access. == Description == Enable Cloudflare Access self-hosted application to protect your `/wp-admin` folder. Add your auth domain and aud settings from Cloudflare Access. Authenticated user will be automatically logined to Wordpress if their email address matches. Follow [Cloudflare document](https://developers.cloudflare.com/cloudflare-one/applications/configure-apps/self-hosted-apps/) to setup Access. You can also define configs in `wp-config.php` define('WP_CF_ACCESS_AUTH_DOMAIN', 'yourdomain.cloudflareaccess.com'); define('WP_CF_ACCESS_JWT_AUD', 'examplef2nat0rkar2866wn829a0x2ztdg'); define('WP_CF_ACCESS_REDIRECT_LOGIN', true); This plugin is not affiliated with nor developed by Cloudflare. All trademarks, service marks and company names are the property of their respective owners. == Frequently Asked Questions == = How do I redirect the WP login page at `/wp-login.php` to Cloudflare Access? = Enable the "Redirect login page" option and all future logins will be redirected to `/wp-admin` and trigger Access authentication. = Why do I get infinite redirect loop after enabling the redirect login page option? = The option assumes that `/wp-admin` folder is protected by Cloudflare Access. If the folder is not protected, then auto-login will fail and redirect back to the login page, causing the redirect loop. == Screenshots == 1. Settings == Changelog == = 1.1.4 = * Fix redirect issue for non-default wp-admin urls = 1.1.3 = * Tested with WordPress 6.1.1 = 1.1.2 = * Tested with WordPress 5.9 * Fixed errors when activated in multi-site enabled installation = 1.1.1 = * Show an error message when user does not exist to prevent redirect loop = 1.0.0 = * Tested with WordPress 5.8 * Update php-jwt to 5.4 * Stable. No major change planned = 0.9.3 = * Tested with WordPress 5.7 = 0.9.2 = * update minimum requirements * update php-jwt to 5.2.1 = 0.9.0 = * First beta release. == Upgrade Notice ==
Hey! Thank you for your wonderful plugin - we really love it here ;-)
Just after your update from yesterday we now receive this message within the debug of our plesk and a login with cloudflare access is no longer possible without a redirect loop? What could be the issue here?
AH01071: Got error 'PHP message: PHP Warning: Undefined array key "CF_Authorization" in httpdocs/wp-content/plugins/auto-login-with-cloudflare/auto-login-with-cloudflare.php on line 111',
Greetings and all the best from Germany,
Felix
When the plugin is enabled, logging in works like a charm but on the dashboard plugins like Elementor AIOSEO and others that require JavaScript to run won't load properly. Specifically, AIOSEO complains about JS loading failure. I'm on WordPress 6.0.2. I really love this plugin but that makes it unusable. Any ideas?
Hey,
I recently had the problem that I got a "too many redirects" error for users that were not yet created in wordpress but are allowed to log in via cloudflare because they are in my gsuite. Currently the error is only "the page is currently not working. too many redirects". Maybe you could catch this error and display it with a good error message.
Best,
Rick
I would like to suggest an idea on how to improve the user-workflow within Wordpress vs. allowed users within Cloudflare:
Currently if a user is not available in Wordpress the whole Login via the Plugin / Cloudflare does not work and this message is stated: User not available
What about an improvement of this process with the creation of a new user if the user is theoretically allowed by cloudflare to login but the user in Wordpress is not yet available?
The master-admin of the website would be able to define a default user-role for everyone that will be created in that way or assign the role each time individually and receives a message with an approval process? This would be pretty cool!
Really like your plugin!
All the best from Germany,
Felix
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.