2017 © Pedro Peláez
 

library hmac-auth

Simple token authentication for PHP

image

zacharyrankin/hmac-auth

Simple token authentication for PHP

  • Saturday, June 13, 2015
  • by zacharyrankin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

hmac-auth

Simple token authentication for PHP, (*1)

Usage

Require via Composer

composer require zacharyrankin/hmac-auth, (*2)

Client

use zacharyrankin\hmac_auth\Authenticator;
use zacharyrankin\hmac_auth\Client;

$auth = new Authenticator;
$token = $auth->createToken(new Client('some user', 'user secret'));
header('X-Authorization-Token: ' . $token);

Server

use zacharyrankin\hmac_auth\Authenticator;
use zacharyrankin\hmac_auth\Client;

$auth = new Authenticator
$auth->authenticate(
  $_SERVER['HTTP_X_AUTHORIZATION_TOKEN'],
  function ($clientId) {
    return new Client($clientId, SomeModel::findSecret($clientId));
  },
  300 // expiration in seconds
);

The Versions

13/06 2015

dev-master

9999999-dev

Simple token authentication for PHP

  Sources   Download

MIT

The Development Requires

13/06 2015

v0.2

0.2.0.0

Simple token authentication for PHP

  Sources   Download

MIT

The Development Requires

13/06 2015

v0.1

0.1.0.0

Simple token authentication for PHP

  Sources   Download

MIT

The Development Requires