2017 © Pedro Peláez
 

library psr15-authentification

image

enderlab/psr15-authentification

  • Friday, October 6, 2017
  • by ender9108
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

psr15-authentification

Build Status Coverage Status, (*1)

Auth Basic

<?php
$basic = new BasicAuthentication([
    'mylogin1' => 'mypassword1',
    'mylogin2' => 'mypassword2'
]);

// Example with enderlab/psr15-middle-earth-framework
$app = \EnderLab\Application\AppFactory::create();
$app->pipe($basic);
$app->run();

Auth digest

<?php
$digest = new DigestAuthentication(
    [
        'mylogin1' => 'mypassword1',
        'mylogin2' => 'mypassword2'
    ],
    uniqid(), // $nonce
    'my digest auth' // $realm
);

// Example with enderlab/psr15-middle-earth-framework
$app = \EnderLab\Application\AppFactory::create();
$app->pipe($digest);
$app->run();

Auth JWT

<?php
$jwt = new JwtAuthentication([
    'privateKey' => 'My secure private key of death',
    'algorithm' => 'HS512'
]);

// Example with enderlab/psr15-middle-earth-framework
$app = \EnderLab\Application\AppFactory::create();
$app->pipe($jwt);
$app->run();

The Versions