https://github.com/fawno/ipauthenticator
IP Authenticator for CakePHP 4 Authentication plugin
https://github.com/fawno/ipauthenticator
authentication authenticator cakephp cakephp-plugin cakephp4 ip ip-authentication
Last synced: about 1 month ago
JSON representation
IP Authenticator for CakePHP 4 Authentication plugin
- Host: GitHub
- URL: https://github.com/fawno/ipauthenticator
- Owner: fawno
- License: mit
- Created: 2025-02-19T00:10:48.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-19T03:24:37.000Z (about 1 year ago)
- Last Synced: 2025-06-07T01:36:30.474Z (10 months ago)
- Topics: authentication, authenticator, cakephp, cakephp-plugin, cakephp4, ip, ip-authentication
- Language: PHP
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/fawno/IPAuthenticator/blob/master/LICENSE)
[](https://github.com/fawno/IPAuthenticator/tags)
[](https://packagist.org/packages/fawno/ip-authentication)
[](https://packagist.org/packages/fawno/ip-authentication/stats)
[](https://github.com/fawno/IPAuthenticator/issues)
[](https://github.com/fawno/IPAuthenticator/network)
[](https://github.com/fawno/IPAuthenticator/stargazers)
# IP Authenticator for CakePHP 4 Authentication plugin
This plugin provides an IP Authenticator for CakePHP 4 authentication plugin.
# Table of contents
- [Requirements](#requirements)
- [Installation](#installation)
## Requirements
- PHP >= 7.2.0
- CakePHP >= 4.3.0
- [CakePHP Authentication](https://book.cakephp.org/authentication/2/en/index.html) >= 2.0
[TOC](#table-of-contents)
## Installation
Install this plugin into your application using [composer](https://getcomposer.org):
- Add `fawno/ip-authentication` package to your project:
```bash
composer require fawno/ip-authentication
```
- Load the IPAuthenticator in your `Application.php`:
```php
use IPAuthenticator\Authenticator\IPAuthenticator;
```
- Load the IPAuthenticator in your Authentication Service (`Application.php`):
```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](#table-of-contents)