dev-master
9999999-devSimple token authentication for PHP
MIT
The Development Requires
v0.2
0.2.0.0Simple token authentication for PHP
MIT
The Development Requires
v0.1
0.1.0.0Simple token authentication for PHP
MIT
The Development Requires
Wallogit.com
2017 © Pedro Peláez
Simple token authentication for PHP
Simple token authentication for PHP, (*1)
composer require zacharyrankin/hmac-auth, (*2)
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);
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
);
Simple token authentication for PHP
MIT
Simple token authentication for PHP
MIT
Simple token authentication for PHP
MIT