PHPackages                             finpin/sezame-sdk - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. finpin/sezame-sdk

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

finpin/sezame-sdk
=================

Passwordless multi-factor authentication

0.9.4(7y ago)096BSD-3-ClausePHPPHP &gt;=5.3.0

Since Mar 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/finpin/sezame-sdk-php)[ Packagist](https://packagist.org/packages/finpin/sezame-sdk)[ Docs](https://seza.me/)[ RSS](/packages/finpin-sezame-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Sezame PHP SDK
==============

[](#sezame-php-sdk)

[![Latest Stable Version](https://camo.githubusercontent.com/1c9bd02b9f048b994e8607a010954aae07acf2a1728bb8030d0e09d5c804a340/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66696e70696e2f73657a616d652d73646b2e737667)](https://packagist.org/packages/finpin/sezame-sdk)[![Total Downloads](https://camo.githubusercontent.com/e00dc0e8f6439aa5961afaf645c66571e991025589a4be2a9e785761e8824476/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66696e70696e2f73657a616d652d73646b2e737667)](https://packagist.org/packages/finpin/sezame-sdk)[![License](https://camo.githubusercontent.com/11d86a2a65c0bef3e55dcc1712827b22731759e241ee2d9cc5a4a1138f3dafe4/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f66696e70696e2f73657a616d652d73646b2e737667)](https://packagist.org/packages/finpin/sezame-sdk)

Passwordless multi-factor authentication.

Unlike password-based solutions that require you to remember just another PIN or password, sezame is a secure and simple multi-factor authentication solution. You only need the username and your fingerprint on your smartphone to log into any sezame-enabled site. Magic – [Sezame](https://seza.me/) – ENTER SIMPLICITY!.

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

[](#installation)

Use [Composer](https://getcomposer.org/) to install the library.

```
$ composer require finpin/sezame-sdk
```

Steps
-----

[](#steps)

To be able to use Sezame within your application you have to fullfill these steps:

1. download and install the Sezame app from an app store
2. follow the registration process in the app
3. register your application/client
4. obtain a SSL client certificate
5. let your users pair their devices with your application
6. issue authentication requests

If you don not have a supported device with fingerprint reader, you must obtain the ssl certificate by using the support channels of Sezame.

Usage
-----

[](#usage)

### register

[](#register)

To be able to connect to the Sezame HQ server, you have to register your client/application, this is done by sending the register call using your recovery e-mail entered during the app installation process. You'll get an authentication request on your Sezame app, which must be authorized.

```
$client = new \SezameLib\Client();

$registerRequest = $client->register()->setEmail('example@example.com')->setName('my new client');

$registerResponse = $registerRequest->send();

$clientcode   = $registerResponse->getClientCode();
$sharedsecret = $registerResponse->getSharedSecret();
```

### sign

[](#sign)

After you have authorized the registration on your mobile device you can request the certificate.

```
$client = new \SezameLib\Client();

$privateKeyPassword = 'somethingsecret';

$csrKey = $client->makeCsr($clientcode, 'example@example.com', $privateKeyPassword,
  Array(
    'countryName'            => 'AT',
    'stateOrProvinceName'    => 'Vienna',
    'localityName'           => 'Vienna',
    'organizationName'       => 'my company name',
    'organizationalUnitName' => 'IT division'
  ));

$signRequest = $client->sign()->setCSR($csrKey->csr)->setSharedSecret($sharedsecret);

$signResponse = $signRequest->send();

$cert = $signResponse->getCertificate();

printf("CSR:\n%s\n\n", $csrKey->csr);
printf("Certificate:\n%s\n\n", $cert);
printf("Private Key:\n%s\n\n", $csrKey->key);
```

Store the certificate and the private key within your system, it is recommended to protect your private key with a secure passphrase. The certificate and the private key is needed for subsequent calls to the Sezame servers, sign and register are the only two calls which can be used without the client certificate.

### pair

[](#pair)

Once you have successfully obtained the client certificate, let your customers pair their devices with your application, this is done by displaying a QR code which is read by the Sezame app.

```
use Endroid\QrCode\Writer;

$client = new \SezameLib\Client($certfile, $keyfile);

$username = 'foo-client-user';

// check pairing status of a certain user
$statusRequest = $client->linkStatus();
$statusResponse = $statusRequest->setUsername($username)->send();

if ($statusResponse->isLinked()) {
  print "user already has been linked\n";
  die;
}

$linkRequest = $client->link();
$linkResponse = $linkRequest->setUsername($username)->send();

if ($linkResponse->isDuplicate()) {
  print "user already has been linked\n";
  die;
}

$qrCode = $linkResponse->getQrCode($username);
$qrCode->setSize(300)->setLabelMargin([
        't' => 10,
        'r' => 10,
        'b' => 10,
        'l' => 10,
]); // optionally adjust qrcode dimensions

printf('', $qrCode->writeString(Writer\PngDataUriWriter::class));

file_put_contents('qrcode.html', sprintf('', $qrCode->writeString(Writer\PngDataUriWriter::class)));
```

### auth

[](#auth)

To authenticate users with Sezame, use the auth call.

```
$client = new \SezameLib\Client($certfile, $keyfile, $keyPassword);
$username = 'foo-client-user';

$timeout = 10;
$authRequest = $client->authorize();
$authRequest->setUsername($username);
$authResponse = $authRequest->send();

if ($authResponse->isNotfound()) {
  // user not paired
}

if ($authResponse->isOk())
{
  $statusRequest = $client->status();
  $statusRequest->setAuthId($authResponse->getId());
  for ($i = 0; $i < $timeout; $i++)
  {
    $statusResponse = $statusRequest->send();
    if ($statusResponse->isAuthorized())
    {
      // request has been authorized
    }
    if ($statusResponse->isDenied())
    {
      // request has been denied
    }

    sleep(1);
  }

  printf("user did not respond within %d seconds\n", $timeout);
}
```

### fraud

[](#fraud)

It is possible to inform users about fraud attempts, this request could be send, if the user logs in using the password.

```
$client = new \SezameLib\Client($certfile, $keyfile, $keyPassword);
$username = 'foo-client-user';
$authRequest = $client->authorize();
$authRequest->setType('fraud');
$authRequest->setUsername($username);
$authResponse = $authRequest->send();
if ($authResponse->isNotfound()) {
  // user not paired
}
if ($authResponse->isOk())
{
  printf("user notified about possible fraud attempt\n");
}
```

### cancel

[](#cancel)

To disable the service use the cancel call, no further requests will be accepted by the Sezame servers:

```
$client = new \SezameLib\Client($certfile, $keyfile, $keyPassword);
$client->cancel()->send();
```

### error handling

[](#error-handling)

The Sezame Lib throws exceptions in the case of an error.

```
$client = new \SezameLib\Client($certfile, $keyfile);
try {
  $client->cancel()->send();
  printf("Client canceled\n");
} catch (\SezameLib\Exception\Connection $e) {
  printf("Connection failure: %s %d\n",
  $e->getMessage(), $e->getCode());
} catch (\SezameLib\Exception\Parameter $e) {
  print_r($e->getErrorInfo());
} catch (\SezameLib\Exception\Response $e) {
  printf("%s %d\n", $e->getMessage(), $e->getCode());
}
```

License
-------

[](#license)

This bundle is under the BSD license. For the full copyright and license information please view the LICENSE file that was distributed with this source code.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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 ~206 days

Total

5

Last Release

2888d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c35e3504583dbf2f9b6520f018785ab95848382348446a8e9a30f3b0a71ff11?d=identicon)[finpin](/maintainers/finpin)

---

Tags

authAuthentication

### Embed Badge

![Health badge](/badges/finpin-sezame-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/finpin-sezame-sdk/health.svg)](https://phpackages.com/packages/finpin-sezame-sdk)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M347](/packages/tymon-jwt-auth)[league/oauth2-server

A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.

6.6k136.0M248](/packages/league-oauth2-server)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M52](/packages/php-open-source-saver-jwt-auth)[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

40820.2M67](/packages/auth0-auth0-php)[kreait/firebase-tokens

A library to work with Firebase tokens

24040.8M14](/packages/kreait-firebase-tokens)[opauth/opauth

Multi-provider authentication framework for PHP

1.6k783.4k58](/packages/opauth-opauth)

PHPackages © 2026

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