Download the PHP package daynnnnn/statamic-forward-auth without Composer

On this page you can find all versions of the php package daynnnnn/statamic-forward-auth. 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 statamic-forward-auth

Statamic Forward Authentication

Use forward authentication to login to statamic.

How it works

Screenshot 2021-07-31 at 16 15 20

Installation

From a standard Statamic site, you can run: composer require daynnnnn/statamic-forward-auth

Then publish the config: php please vendor:publish --tag="statamic-forward-authentication"

Setup

First you'll need to adjust your config/auth.php to use the forward driver on the user provider:

Then you can edit config/statamic/forward-authentication.php to setup authentication

Types

By default, there's 2 supported services: http and ldap

These can be selected via the default value in config/statamic/forward-authentication.php

LDAP

Description

An ldap search will be made of the base_dn to find the user. If the user is found, try to bind to the found user using provided password.

Config

host: (array) List of LDAP hsots

use_ssl: (bool) Whether host should be accessed with SSL

base_dn: (string) Root search DN to find user in.

username: (string) Bind users DN.

password: (string) Bind users password.

Requirements

The LDAP auth service requires LdapRecord:

composer require directorytree/ldaprecord

HTTP Authentication

Description

A POST request will be sent to the endpoint with the attributes of email and password. The expected response is JSON, and should contain the success status of the credentials, and if the success status is true, the full name of a user.

Config

endpoint: (string) Address on which login will be attempted

result: (array) Where the success status and full name of the user can be found in the JSON response, example:

If your JSON response looks like this:

Your result array should look like this:

Extending

You can also extend this to add your own form of forward authentication, you'll need to create a new class which implements the AuthServiceContract interface, and then set a service in config/statamic/forward-authentication.php. With the service, the only requirment is that the driver is defined as your class, like this:

'driver' => App\AuthServices\MyCustomAuthService::class,

The rest of the config can be setup based on what your custom authentication service needs.


All versions of statamic-forward-auth with dependencies

PHP Build Version
Package Version
Requires statamic/cms Version ^3.0 || ^4.0 || ^5.0
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 daynnnnn/statamic-forward-auth contains the following files

Loading the files please wait ....