Download the PHP package jamesmorrison/cloudflare-access-sso without Composer

On this page you can find all versions of the php package jamesmorrison/cloudflare-access-sso. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cloudflare-access-sso

Cloudflare Access SSO for WordPress

Cloudflare Access SSO (Single Sign On) is a plugin to facilitate auto-login to WordPress. The plugin relies on authorisation by Cloudflare, so it's important that you follow this setup guide carefully to ensure your site remains secure. For further guidance, refer to Cloudflare Documentation: Add Site to Cloudflare.

Note: If you don't currently use Cloudflare and don't plan to, this plugin probably isn't suitable for your site.

Cloudflare Access Setup

In order to use Cloudflare Access for SSO, you must create an application that covers wp-login.php on the site you wish to protect. No other URLs are required to be protected for this to function, but for better security you may wish to include others. Note that (as of June, 2023) it is not possible to define more than one path in a single application; for now multiple applications are required if you additionally wish to protect /wp-admin.

Follow this guide to create a Cloudflare Access Application: Self Hosted Applications

Plugin Configuration

Two constants are required to be set in wp-config.php (note: a settings page will be added in a future release):

CF_ACCESS_TEAM_NAME The Cloudflare Access Team Name To get the Team Name:

Example for wp-config.php: define( 'CF_ACCESS_TEAM_NAME', 'mysite' );

CF_ACCESS_AUD The Application Audience (AUD) Tag for the Cloudflare Access application To get the Application Audience (AUD) Tag

Example for wp-config.php: define( 'CF_ACCESS_AUD', '12345-67890-12345-67890-12345-67890' );

Note: If you have multiple Cloudflare Access Applications, ensure the AUD covers wp-login.php - if it doesn't, SSO will not function correctly.

CF_ACCESS_AUD accepts a single string (per example above) or an array of strings, like this:

Optionally, four additional constants can also be set:

CF_ACCESS_ATTEMPTS The number of attempts to login via Cloudflare Access.

Default: (int) 3 if not set.

CF_ACCESS_LEEWAY The number of seconds leeway allowed in the authorisation headers.

Default (int) 60 if not set.

CF_ACCESS_CREATE_ACCOUNT Whether an account should be created for a (Cloudflare) authenticated user if it doesn't exist Note: This is dependent on the settings for your Cloudflare Access application; if you only allow "internal" users, "external" users won't be able to access the site at all.

Default: (bool) false if not set.

CF_ACCESS_NEW_USER_ROLE The role for user accounts created. Requires CF_ACCESS_CREATE_ACCOUNT to be true (is otherwise ignored).

Default: (string) subscriber

Note: Where the application is not configured correctly (authorisation header is not set, or the team name / AUD are incorrect), SSO is silently disabled. You can check the cookies section of inspector tools to confirm whether the cookie has been set.

Disclaimer

This plugin is not affiliated with nor developed by Cloudflare. All trademarks, service marks and company names are the property of their respective owners.


All versions of cloudflare-access-sso with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
firebase/php-jwt Version ^6.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jamesmorrison/cloudflare-access-sso contains the following files

Loading the files please wait ...