PHP code example of fawno / ip-authentication

1. Go to this page and download the library: Download fawno/ip-authentication library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fawno / ip-authentication example snippets


  use IPAuthenticator\Authenticator\IPAuthenticator;
  

  // 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',
              ],
          ],
      ],
  ]);