proit365 / laravel-multikey-auth
Laravel 12 client integration for ProIT365 MultiKey Auth MKAP v1
Requires
- php: ^8.2
- illuminate/http: ^12.0
- illuminate/support: ^12.0
- proit365/multikey-auth: ^1.0
Requires (Dev)
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
proit365/laravel-multikey-auth integrates the PHP MKAP client with Laravel
12. It requires PHP ^8.2 and Laravel 12, publishes configuration, and exposes
the client through dependency injection or the MKAP facade.
Installation
After the package and its PHP client dependency are available from Packagist:
composer require proit365/laravel-multikey-auth:^1.0
Then publish its configuration:
php artisan vendor:publish --tag=mkap-client-config
Set MKAP_BASE_URI, MKAP_CLIENT_ID, MKAP_POOL_VERSION,
MKAP_IDENTIFIER_LENGTH, MKAP_IDENTIFIER_ALPHABET, and MKAP_EXPORT_PATH.
The export must contain the active client pool secrets and must be readable only
by the application service account.
The package does not use Laravel's HTTP redirects. Laravel's HTTP transport is used only to send the challenge and signed API request. Application callers serialize the exact body once and pass those bytes:
use ProIT365\MultiKeyAuth\LaravelClient\Facades\MKAP; $body = json_encode(['status' => 'pending'], JSON_THROW_ON_ERROR); $response = MKAP::post('/api/orders', $body); if ($response->statusCode !== 200) { throw new RuntimeException('API request failed.'); }
Dependency-injection use:
public function handle( \ProIT365\MultiKeyAuth\LaravelClient\LaravelMultiKeyClient $client ) { return $client->get('/api/orders'); }
The package exposes challenge and malformed-response exceptions from the PHP
client. API 401 responses are returned unchanged and are not replayed.
Tests
From a clean package checkout, install development dependencies and run:
composer install
composer test
Source and support
Project website: https://www.proit365.com.
The monorepo is the development source of truth: github.com/proit365/multikey-auth. Report issues through its issue tracker.