PHP library to sign and verify requests

There is no license information available for the latest version (0.1) of this package.

PHP library to sign and verify requests

README

arthens/request-signer is a PHP library to sign and validate requests.

The implementation is inspired by the AWS Rest Authentication tutorial.

Build Status

Installation

Add arthens/request-signer to your composer.json.

You can also download request-signer directly, as it doesn’t have any dependency.

Usage

// Use composer or import the class manually
require 'vendor/autoload.php';

// Create a new Signer
$signer = new ArthensRequestSignerSigner('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');
}

Source

Add a Comment

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *