passageidentity/passage-php

Passage's management API to manage your Passage apps and users.


README

Passage logo

passage-php

This PHP SDK allows for verification of server-side authentication for applications using Passage

For more information, please visit Passage Documentation.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$app_id = 'app_id_example'; // string | App ID
$api_key = 'app_id_example'; // string | App ID
$passageInstance = new Passage\Client\Controllers\Passage(
  $app_id,
  $api_key
);

try {
    $result = $passageInstance->getApp($app_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AppsApi->getApp: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.passage.id/v1

Class Method HTTP request Description
AppsApi getApp GET /apps/{app_id} Get App
MagicLinksApi createMagicLink POST /apps/{app_id}/magic-links Create Embeddable Magic Link
TokensApi revokeUserRefreshTokens DELETE /apps/{app_id}/users/{user_id}/tokens Revokes refresh tokens
UserDevicesApi deleteUserDevices DELETE /apps/{app_id}/users/{user_id}/devices/{device_id} Delete a device for a user
UserDevicesApi listUserDevices GET /apps/{app_id}/users/{user_id}/devices List User Devices
UsersApi activateUser PATCH /apps/{app_id}/users/{user_id}/activate Activate User
UsersApi createUser POST /apps/{app_id}/users Create User
UsersApi deactivateUser PATCH /apps/{app_id}/users/{user_id}/deactivate Deactivate User
UsersApi deleteUser DELETE /apps/{app_id}/users/{user_id} Delete User
UsersApi getUser GET /apps/{app_id}/users/{user_id} Get User
UsersApi getUserByIdentifier GET /apps/{app_id}/users Get User By Identifier
UsersApi updateUser PATCH /apps/{app_id}/users/{user_id} Update User

Models

Authorization

Authentication schemes defined for the API:

bearerAuth

Type: Bearer authentication (JWT)

Method: validateJWT

Tests

To run the tests, use:

composer install
vendor/bin/phpunit