Skip to content

Latest commit

 

History

History
58 lines (45 loc) · 2.19 KB

README.md

File metadata and controls

58 lines (45 loc) · 2.19 KB

GitHub license GitHub tag (latest SemVer) Packagist Packagist Downloads GitHub issues GitHub forks GitHub stars

IP Authenticator for CakePHP 4 Authentication plugin

This plugin provides an IP Authenticator for CakePHP 4 authentication plugin.

Table of contents

Requirements

TOC

Installation

Install this plugin into your application using composer:

  • Add fawno/ip-authentication package to your project:
      composer require fawno/ip-authentication
  • Load the IPAuthenticator in your Application.php:
    use IPAuthenticator\Authenticator\IPAuthenticator;
  • Load the IPAuthenticator in your Authentication Service (Application.php):
    // Load the authenticators. Session should be first.
    $service->loadAuthenticator('Authentication.Session');
    
    $service->loadAuthenticator(IPAuthenticator::class, [
        'auth' => [
            '127.0.0.1' => [
                'username' => 'localhost',
                'displayname' => 'Local Host',
                'dn' => [],
                'memberof' => [
                    'Group' => 'Group',
                ],
            ],
        ],
    ]);

TOC