passageidentity/passage-php

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

dev-main 2024-04-03 22:07 UTC

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

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