PHP code example of aporat / laravel-auth-signature
1. Go to this page and download the library: Download aporat/laravel-auth-signature library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
aporat / laravel-auth-signature example snippets
return [
/*
| Defines the time window, in seconds, for which a signature is valid.
| This helps prevent replay attacks. Default is 300 seconds (5 minutes).
*/
'timestamp_tolerance_seconds' => 300,
/*
| Define each client that can make signed requests.
| The key is the Client ID sent in the `X-Auth-Client-ID` header.
*/
'clients' => [
'your-client-id' => [
// The secret key used to sign requests for this client.
'client_secret' => env('CLIENT_SECRET_KEY'),
// The bundle ID or unique identifier for the client application.
'bundle_id' => 'com.yourcompany.yourapp',
// (Optional) The minimum auth version this client must use.
'min_auth_level' => 10,
],
],
/*
| Define rules for different signature versions.
| This allows you to evolve your signature algorithm over time.
*/
'auth_versions' => [
10 => [
// (Optional) A version-specific secret appended to the client's secret.
'secret' => env('AUTH_V10_SECRET'),
// (Optional) A static string