PHP Request Signer
arthens/request-signer is a PHP library to sign and validate requests., (*1)
The implementation is inspired by the AWS Rest Authentication tutorial., (*2)
, (*3)
Installation
Add arthens/request-signer to your composer.json., (*4)
You can also download request-signer directly, as it doesn't have any dependency., (*5)
Usage
// Use composer or import the class manually
require 'vendor/autoload.php';
// Create a new Signer
$signer = new \Arthens\RequestSigner\Signer('here-your-secret-key');
// Generate a new url-friendly signature
$signature = $signer->sign('GET', '/news');
// Verify a signature
if (!$signer->verify('here-the-signature-from-request', 'GET', '/news')) {
throw new \Exception('Invalid signature');
}