Code Monkey home page Code Monkey logo

auto-login-with-cloudflare's Introduction

=== 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 ==

auto-login-with-cloudflare's People

Contributors

dailydome avatar kanru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

auto-login-with-cloudflare's Issues

Too many redirects when user is not found

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

JS won't load when enabled

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?

Idea: Improved User Management

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

Broken after Last Update

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.