Download the PHP package havenshen/larsign without Composer
On this page you can find all versions of the php package havenshen/larsign. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download havenshen/larsign
More information about havenshen/larsign
Files in havenshen/larsign
Package larsign
Short Description Laravel signature certification with web API server.
License MIT
Informations about the package larsign
Api Authorized Signature Middleware for Laravel 5
About
The larsign
package authorized signature server.
Features
- Handles larsign requests
Installation
Laravel
Require the havenshen/larsign
package in your composer.json
and update your dependencies:
Add the HavenShen\Larsign\LarsignServiceProvider
to your config/app.php
providers array:
Add the HavenShen\Larsign\LarsignFacade
to your config/app.php
aliases array:
Lumen
Require the havenshen/larsign
package in your composer.json
and update your dependencies:
Register the package with lumen in bootstrap/app.php
with the following:
Global usage
To allow Larsign for all your routes, add the HandleLarsign
middleware in the $middleware
property of app/Http/Kernel.php
class:
Group middleware
If you want to allow Larsign on a specific middleware group or route, add the HandleLarsign
middleware to your group:
Application route middleware
If you want to allow Larsign on a specific application middleware or route, add the HandleLarsign
middleware to your application route:
Configuration
The defaults are set in config/larsign.php
. Copy this file to your own config directory to modify the values. If you're using Laravel, you can publish the config using this command:
If you're using Lumen, Copy the configuration larsign.php
from vendor/havenshen/larsign/config/larsign.php
to your config/
directory
Add api route in routes/api.php
Copy this.
or
Client
Generate Larsign
signatures
-
Assume the following management credentials:
-
Call interface address:
-
The original string to be signed:
note: the time-stamping followed by a newline [currenttime + voucher valid seconds]
-
Base64 url safe encode:
-
hmac_sha1
carriesSecretKey
encryption then base64 url safe encode: -
The final administrative credentials are:
note: stitching
headerName
SpaceAccessKey
:sign
:signingStrBase64UrlSafeEncode
- Add http header:
note: header key in
config/larsign.php -> headerName
Client signature authorization failed
Testing
License
The MIT License (MIT). Please see License File for more information.