PHPackages                             currence/idin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. currence/idin

ActiveLibrary[API Development](/categories/api)

currence/idin
=============

A PHP library for working with the iDIN protocol

2.0.0(1mo ago)635.6k↓55.5%7[1 issues](https://github.com/Currence-Online/iDIN-libraries-php/issues)MITPHPPHP ^8.3CI failing

Since Nov 12Pushed 1mo ago6 watchersCompare

[ Source](https://github.com/Currence-Online/iDIN-libraries-php)[ Packagist](https://packagist.org/packages/currence/idin)[ RSS](/packages/currence-idin/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (4)Versions (10)Used By (0)

iDIN PHP Library
================

[](#idin-php-library)

A PHP library for integrating with the iDIN identity verification protocol.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Extensions: `dom`, `simplexml`, `curl`, `openssl`

Installation
------------

[](#installation)

```
composer require currence/idin
```

Configuration
-------------

[](#configuration)

Create a configuration from an XML file:

```
use BankId\Merchant\Configuration\Configuration;

$config = Configuration::load('path/to/bankid-config.xml');
```

Or construct directly:

```
$config = new Configuration(
    merchantID: '0123456789',
    merchantSubID: '0',
    merchantReturnUrl: 'https://my.shop/callback',
    acquirerDirectoryUrl: 'https://bank/directory',
    acquirerTransactionUrl: 'https://bank/transaction',
    acquirerStatusUrl: 'https://bank/status',
    merchantCertificateFile: 'certs/merchant.p12',
    merchantCertificatePassword: 'password',
    routingServiceCertificateFile: 'certs/routing.cer',
    routingServiceCertificateFileAlternative: '',
    samlCertificateFile: 'certs/saml.p12',
    samlCertificatePassword: 'password',
    logsEnabled: true,
    logsLocation: './logs',
    logsPattern: '%Y-%M-%D',
    logsFileName: 'iDIN.txt',
    serviceLogsEnabled: true,
    serviceLogsLocation: './logs',
    serviceLogsPattern: '%Y-%M-%D/%h%m%s.%f-%a.xml',
);
```

Usage
-----

[](#usage)

### Get directory of issuers

[](#get-directory-of-issuers)

```
use BankId\Merchant\Communicator\Communicator;

$comm = new Communicator($config);
$response = $comm->getDirectory();

if (!$response->IsError) {
    foreach ($response->Issuers as $issuer) {
        echo $issuer->name . ' (' . $issuer->id . ')' . PHP_EOL;
    }
}
```

### Start authentication

[](#start-authentication)

```
use BankId\Merchant\Request\AuthenticationRequest;
use BankId\Merchant\Enum\AssuranceLevel;

$auth = new AuthenticationRequest();
$auth->issuerID = 'INGBNL2A';
$auth->merchantReference = AuthenticationRequest::generateMerchantReference();
$auth->requestedServiceID = '21968';
$auth->assuranceLevel = AssuranceLevel::Loa3->value;
$auth->entranceCode = bin2hex(random_bytes(16));
$auth->language = 'nl';

$response = $comm->newAuthenticationRequest($auth);

if (!$response->IsError) {
    // Redirect consumer to the bank
    header('Location: ' . $response->IssuerAuthenticationURL);
}
```

### Check transaction status

[](#check-transaction-status)

```
use BankId\Merchant\Enum\TransactionStatus;

$response = $comm->getResponse($transactionID);

if (!$response->IsError && $response->Status === TransactionStatus::Success) {
    $attributes = $response->SamlResponse->attributes;
    // Access consumer attributes
}
```

Example website
---------------

[](#example-website)

An example web application is included in the `examples/` directory. To run it:

```
cd examples
php -S localhost:8080
```

Fill in the values in `examples/bankid-config.xml` before using.

Project structure
-----------------

[](#project-structure)

```
src/
├── Communicator/       Main entry point
├── Configuration/      Configuration management
├── Contract/           Interfaces (LoggerInterface)
├── Enum/               Enums (TransactionStatus, AssuranceLevel, etc.)
├── Exception/          CommunicatorException
├── Logger/             Logger and NullLogger
├── Request/            AuthenticationRequest
├── Resources/          XSD schemas and CA certificate
├── Response/           Response classes and SAML handling
├── Saml/               SAML attribute constants
├── Validation/         Request and XML validation
└── Xml/                XML building, signing, and utilities

```

Running tests
-------------

[](#running-tests)

```
composer install
vendor/bin/phpunit
```

License
-------

[](#license)

Proprietary - see [LICENSE](LICENSE) for details.

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance85

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~473 days

Recently: every ~552 days

Total

6

Last Release

59d ago

Major Versions

1.3.0 → 2.0.0.x-dev2026-05-05

PHP version history (3 changes)1.2.4PHP &gt;= 5.4

1.2.7PHP &gt;7.3

1.3.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a0edaaad0542c99bb103d6139d10a75e7cfc55cc2264cf550607d0ec9948af1?d=identicon)[maxcode-devops-blue](/maintainers/maxcode-devops-blue)

---

Top Contributors

[![cristianmihaita-maxcode](https://avatars.githubusercontent.com/u/265009003?v=4)](https://github.com/cristianmihaita-maxcode "cristianmihaita-maxcode (10 commits)")[![grigoresc](https://avatars.githubusercontent.com/u/2048798?v=4)](https://github.com/grigoresc "grigoresc (6 commits)")[![dvdmunckhof](https://avatars.githubusercontent.com/u/3891060?v=4)](https://github.com/dvdmunckhof "dvdmunckhof (5 commits)")[![cristian-mihaitactin](https://avatars.githubusercontent.com/u/23001221?v=4)](https://github.com/cristian-mihaitactin "cristian-mihaitactin (4 commits)")[![maxcode-devops-blue](https://avatars.githubusercontent.com/u/65350856?v=4)](https://github.com/maxcode-devops-blue "maxcode-devops-blue (3 commits)")[![joostd](https://avatars.githubusercontent.com/u/668631?v=4)](https://github.com/joostd "joostd (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/currence-idin/health.svg)

```
[![Health](https://phpackages.com/badges/currence-idin/health.svg)](https://phpackages.com/packages/currence-idin)
```

###  Alternatives

[litesaml/lightsaml

SAML 2.0 PHP library

1076.3M24](/packages/litesaml-lightsaml)[egroupware/egroupware

EGroupware extends a classic groupware with an integrated CRM-system, a secure file-server and Collabora Online Office.

2931.7k](/packages/egroupware-egroupware)[kaleu62/notafiscalsp

Integração com o WebService da Prefeitura de São Paulo para emissão de NFS e NTFS utilizando a API da nota do milhão

5733.7k](/packages/kaleu62-notafiscalsp)[phpcfdi/finkok

Librería para conectar con la API de servicios de FINKOK

2214.1k](/packages/phpcfdi-finkok)[mazinsw/nfe-api

API para geração e envio de notas fiscais eletrônicas brasileiras

621.4k](/packages/mazinsw-nfe-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
