PHPackages                             conduction/id-vault-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. conduction/id-vault-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

conduction/id-vault-php
=======================

Library for ID-Vault functionality

05.4kPHP

Since Jan 12Pushed 5y ago3 watchersCompare

[ Source](https://github.com/ConductionNL/id-vault-php)[ Packagist](https://packagist.org/packages/conduction/id-vault-php)[ RSS](/packages/conduction-id-vault-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (4)Used By (0)

id-Vault API client for PHP
===========================

[](#id-vault-api-client-for-php)

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

[](#requirements)

To use the id-Vault API client, the following things are required:

- Get yourself a [id-Vault Account](https://www.id-vault.com). And make sure you have an organization and application set up.
- PHP &gt;= 7.1.3

Composer Installation
---------------------

[](#composer-installation)

By far the easiest way to install the id-Vault API client is to require it with [Composer](http://getcomposer.org/doc/00-intro.md).

```
$ composer require conduction/id-vault-php:dev-main

{
    "require": {
        "conduction/id-vault-php": "dev-main"
    }
}

```

Getting started
---------------

[](#getting-started)

Initializing the id-Vault API client.

```
$idVault = new \Conduction\IdVaultApi\IdVaultApiClient();
```

Sending emails
--------------

[](#sending-emails)

This function allows us to send mails through id-vault.

```
$body = ' test mail ';
$mail = $idVault->sendMail('62817d5c-0ba5-4aaa-81f2-ad0e5a763cd4', $body, 'test mail', 'gino@conduction.nl', 'no-reply@id-vault.com');
```

For this to work you have to make sure your mailgun key is available in your id-vault application. The function will then use the Mailgun key to send the email to the provided receiver.

Make sure you provide a valid html body for the email.

Authenticating users
--------------------

[](#authenticating-users)

We can use the `$idVault->authenticateUser();` to retrieve user information from id-Vault. We do this by providing the function with:

- code provided by the `https://id-vault.com/oath` endpoint.
- the application id.
- the application secret.
- (optional) state.

```
$user = $idVault->authenticateUser('fecbf5ca-a28b-41a1-8e6a-77e8f8939710', '05dd458d-9f33-4f16-9ec3-8d7f0a3b0791', '024a820d-860c-4ad5-b4c7-e507334e949f');
```

This then returns the following json object:

```
{
    "tokenType": "bearer",
    "expiresIn": "3600",
    "scope": "schema.person.email+schema.person.given_name+schema.person.family_name",
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0NTVmNzgyZS00YjJkLTRjYmItYWU4My02ZTI5N2UyNWZlZjkiLCJuYW1lIjoiTWFybGVlbiBSb21pam4iLCJlbWFpbCI6Im1hcmxlZW5yb21pam43M0BnbWFpbC5jb20iLCJnaXZlbl9uYW1lIjoiTWFybGVlbiIsImZhbWlseV9uYW1lIjoiUm9taWpuIiwiY2xhaW1zIjp7InNjaGVtYS5wZXJzb24uZW1haWwiOlt7ImVtYWlsIjoibWFybGVlbnJvbWlqbjczQGdtYWlsLmNvbSJ9XSwic2NoZW1hLnBlcnNvbi5naXZlbl9uYW1lIjpbeyJnaXZlbl9uYW1lIjoiTWFybGVlbiJ9XSwic2NoZW1hLnBlcnNvbi5mYW1pbHlfbmFtZSI6W3siZmFtaWx5X25hbWUiOiJSb21pam4ifV19LCJpc3MiOiI0NTVmNzgyZS00YjJkLTRjYmItYWU4My02ZTI5N2UyNWZlZjkiLCJhdWQiOiJodHRwczpcL1wvZGV2LmNoZWNraW5nLm51XC91c2Vyc1wvYXV0aFwvaWR2YXVsdCIsImV4cCI6IjM2MDAiLCJqdGkiOiIxMDMzYzFmMy1hNzhkLTQ0Y2ItYWQxMy0zZjg4OGUwNzA0MTEiLCJhbGciOiJIUzI1NiIsImlhdCI6MTYwNzUxOTczMn0.Psq2XnCrgIgNQ-R4PHvctmCgC-VUhjBBNUFasHB0lAE",
    "state": "XXXX-XXXX-XXXX-XXXX",
    "newUser": true
}
```

In this JSON object access\_token is an JWT token which holds the requested user information.

which looks like this:

```
{
  "sub": "455f782e-4b2d-4cbb-ae83-6e297e25fef9",
  "name": "test person",
  "email": "testperson@gmail.com",
  "given_name": "test",
  "family_name": "person",
  "claims": {
    "schema.person.email": [
      {
        "email": "testperson@gmail.com"
      }
    ],
    "schema.person.given_name": [
      {
        "given_name": "Test"
      }
    ],
    "schema.person.family_name": [
      {
        "family_name": "Person"
      }
    ]
  },
  "iss": "455f782e-4b2d-4cbb-ae83-6e297e25fef9",
  "aud": "https://checking.nu/users/auth/idvault",
  "exp": "3600",
  "jti": "1033c1f3-a78d-44cb-ad13-3f888e070411",
  "alg": "HS256",
  "iat": 1607519732
}
```

Creating dossiers
-----------------

[](#creating-dossiers)

With this function we are able to create a dossier for an id-vault user.

We do this by providing the function with:

- array of scopes this dossier requires (the scopes must be authorized by the id-vault user).
- access\_token provided by id-vault.
- name of the dossier.
- goal of the dossier.
- expire date of the dossier.
- url where the user can find the dossier.
- (optional) description of the dossier.
- whether the dossier is on legal basis.

```
$scopes = ['schema.person.family_name', 'schema.person.given_name'];
$accesToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0NTVmNzgyZS00YjJkLTRjYmItYWU4My02ZTI5N2UyNWZlZjkiLCJuYW1lIjoiTWFybGVlbiBSb21pam4iLCJlbWFpbCI6Im1hcmxlZW5yb21pam43M0BnbWFpbC5jb20iLCJnaXZlbl9uYW1lIjoiTWFybGVlbiIsImZhbWlseV9uYW1lIjoiUm9taWpuIiwiY2xhaW1zIjp7InNjaGVtYS5wZXJzb24uZW1haWwiOlt7ImVtYWlsIjoibWFybGVlbnJvbWlqbjczQGdtYWlsLmNvbSJ9XSwic2NoZW1hLnBlcnNvbi5naXZlbl9uYW1lIjpbeyJnaXZlbl9uYW1lIjoiTWFybGVlbiJ9XSwic2NoZW1hLnBlcnNvbi5mYW1pbHlfbmFtZSI6W3siZmFtaWx5X25hbWUiOiJSb21pam4ifV19LCJpc3MiOiI0NTVmNzgyZS00YjJkLTRjYmItYWU4My02ZTI5N2UyNWZlZjkiLCJhdWQiOiJodHRwczpcL1wvZGV2LmNoZWNraW5nLm51XC91c2Vyc1wvYXV0aFwvaWR2YXVsdCIsImV4cCI6IjM2MDAiLCJqdGkiOiIxMDMzYzFmMy1hNzhkLTQ0Y2ItYWQxMy0zZjg4OGUwNzA0MTEiLCJhbGciOiJIUzI1NiIsImlhdCI6MTYwNzUxOTczMn0.Psq2XnCrgIgNQ-R4PHvctmCgC-VUhjBBNUFasHB0lAE";

$user = $idVault->createDossier($scopes, $accesToken, 'employee file', 'document employee', '05-12-2021 12:00', 'https://test.com/dossiers', 'this is your employee file', false);
```

The function returns the response from id-Vault as an array.

The id-vault user will then receive a notification that a dossier got added to his account and is able to view the dossier in the dashboard.

Get scopes
----------

[](#get-scopes)

With this function we are able to request additional scopes from a user we currently have a valid authorization with.

We do this by providing the function with:

- array of scopes we want to request from the user.
- access\_token provided by id-vault.

```
$scopes = ['schema.person.family_name', 'schema.person.given_name'];
$accesToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0NTVmNzgyZS00YjJkLTRjYmItYWU4My02ZTI5N2UyNWZlZjkiLCJuYW1lIjoiTWFybGVlbiBSb21pam4iLCJlbWFpbCI6Im1hcmxlZW5yb21pam43M0BnbWFpbC5jb20iLCJnaXZlbl9uYW1lIjoiTWFybGVlbiIsImZhbWlseV9uYW1lIjoiUm9taWpuIiwiY2xhaW1zIjp7InNjaGVtYS5wZXJzb24uZW1haWwiOlt7ImVtYWlsIjoibWFybGVlbnJvbWlqbjczQGdtYWlsLmNvbSJ9XSwic2NoZW1hLnBlcnNvbi5naXZlbl9uYW1lIjpbeyJnaXZlbl9uYW1lIjoiTWFybGVlbiJ9XSwic2NoZW1hLnBlcnNvbi5mYW1pbHlfbmFtZSI6W3siZmFtaWx5X25hbWUiOiJSb21pam4ifV19LCJpc3MiOiI0NTVmNzgyZS00YjJkLTRjYmItYWU4My02ZTI5N2UyNWZlZjkiLCJhdWQiOiJodHRwczpcL1wvZGV2LmNoZWNraW5nLm51XC91c2Vyc1wvYXV0aFwvaWR2YXVsdCIsImV4cCI6IjM2MDAiLCJqdGkiOiIxMDMzYzFmMy1hNzhkLTQ0Y2ItYWQxMy0zZjg4OGUwNzA0MTEiLCJhbGciOiJIUzI1NiIsImlhdCI6MTYwNzUxOTczMn0.Psq2XnCrgIgNQ-R4PHvctmCgC-VUhjBBNUFasHB0lAE";

$user = $idVault->getScopes($scopes, $accesToken);
```

The function returns the response from id-Vault as an array.

The id-vault user will then receive a notification that your application is requesting additional scopes. The user will then either approve the new scopes or decline them.

API documentation
-----------------

[](#api-documentation)

If you wish to learn more about our API, please visit the [id-Vault documentation](https://id-vault.com/docs/). API Documentation is available in English.

License
-------

[](#license)

Copyright (c) 2018 Copyright. All Rights Reserved. Made with love by **Conduction**.

Support
-------

[](#support)

Contact: [www.conduction.nl ](https://conduction.nl) —

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 56% of commits — single point of failure

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4021899?v=4)[Ruben van der Linde](/maintainers/rubenvdlinde)[@rubenvdlinde](https://github.com/rubenvdlinde)

---

Top Contributors

[![WilcoLouwerse](https://avatars.githubusercontent.com/u/3785488?v=4)](https://github.com/WilcoLouwerse "WilcoLouwerse (28 commits)")[![ginokok1996](https://avatars.githubusercontent.com/u/61521033?v=4)](https://github.com/ginokok1996 "ginokok1996 (22 commits)")

### Embed Badge

![Health badge](/badges/conduction-id-vault-php/health.svg)

```
[![Health](https://phpackages.com/badges/conduction-id-vault-php/health.svg)](https://phpackages.com/packages/conduction-id-vault-php)
```

###  Alternatives

[96qbhy/tt-microapp

字节跳动小程序sdk

728.9k](/packages/96qbhy-tt-microapp)[madeitbelgium/wappalyzer

PHP Library that uncovers the technologies used on websites.

1417.5k](/packages/madeitbelgium-wappalyzer)

PHPackages © 2026

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