Search by

identisure / client

aesy

PHP client for the Identisure REST API

v0.1.0 2026-10-28 20:27 UTC

This package is auto-updated.

Last update: 2026-10-29 13:50:43 UTC


README

Identisure PHP Client

Packagist version Documentation MIT license

API client for the Identisure REST API.

Documentation: identisure.github.io/api-client-php

Requirements

PHP 8.3 or later, and a PSR-18 HTTP client (Guzzle is used automatically if installed).

Supported providers

  • 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

Installation

composer require identisure/client

A PSR-18 HTTP client is required. The client auto-discovers Guzzle if installed:

composer require guzzlehttp/guzzle

Alternatively, inject any PSR-18 client via the builder.

Usage

<?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";
}

Verifying callbacks

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);

Development

Prerequisites

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.

Build

composer install

Test

composer test

Check

composer check

Release

Set the version in src/Transport.php and commit. Then push a tag:

git tag v0.1.0
git push origin v0.1.0

The release workflow checks that the tag matches the version, runs CI and creates a GitHub release. Packagist picks up new tags on its own.

Other languages

C#, Dart, Go, TypeScript/JavaScript, Java/Kotlin, Python, Ruby, Rust, Swift