API client for the Identisure REST API.
Documentation: identisure.github.io/api-client-php
PHP 8.3 or later, and a PSR-18 HTTP client (Guzzle is used automatically if installed).
- BankID SE: auth, sign, phone auth and sign, QR verify, age verification
- BankID NO: auth, backchannel auth, sign, age verification
- Freja eID: auth, backchannel auth, sign, backchannel sign, age verification
- MitID: auth, backchannel auth, sign, age verification
- FTN (Finnish Trust Network): auth, age verification
- Vipps MobilePay: auth, backchannel auth
- Documents: upload and download documents for signing
composer require identisure/clientA PSR-18 HTTP client is required. The client auto-discovers Guzzle if installed:
composer require guzzlehttp/guzzleAlternatively, inject any PSR-18 client via the builder.
<?php
use Identisure\Client\Environment;
use Identisure\Client\IdentisureClientBuilder;
use Identisure\Client\Models\BankIdSe\BankIdSeAuthRequest;
use Identisure\Client\Models\BankIdSe\BankIdSeCompleted;
use Identisure\Client\Models\BankIdSe\BankIdSeFailed;
use Identisure\Client\Models\BankIdSe\BankIdSePending;
$client = (new IdentisureClientBuilder('client_id', 'client_secret'))
->environment(Environment::Staging)
->build();
$session = $client->bankIdSe()->auth(new BankIdSeAuthRequest());
assert($session instanceof BankIdSePending);
echo "Session ID: {$session->id}\n";
$result = $client->bankIdSe()->waitForAuth($session->id);
if ($result instanceof BankIdSeCompleted) {
echo "Authenticated: {$result->name} ({$result->ssn})\n";
} elseif ($result instanceof BankIdSeFailed) {
echo "Failed: {$result->error}\n";
}Pass the raw request body exactly as received, before parsing it.
use Identisure\Client\CallbackSignature;
$valid = CallbackSignature::verify($rawBody, $request->getHeaderLine('X-Signature-SHA256'), $hmacSecret);- PHP 8.3+
- Composer
The tests use shared fixtures from a git submodule. Clone with
git clone --recurse-submodules, or run git submodule update --init in an
existing clone.
composer installcomposer testcomposer checkSet the version in src/Transport.php and commit. Then push a tag:
git tag v0.1.0
git push origin v0.1.0The release workflow checks that the tag matches the version, runs CI and creates a GitHub release. Packagist picks up new tags on its own.
C#, Dart, Go, TypeScript/JavaScript, Java/Kotlin, Python, Ruby, Rust, Swift