CriiptoDOCS
  1. Integrations
  2. PHP

Setup OpenID-Connect-PHP

Requirements

  1. PHP 5.4 or greater
  2. CURL extension
  3. JSON extension
  4. XML extension

Install

  1. Install library using composer
composer require jumbojett/openid-connect-php
  1. Include composer autoloader
require __DIR__ . '/vendor/autoload.php';

Implementation

require __DIR__ . '/vendor/autoload.php';
use Jumbojett\OpenIDConnectClient;

$oidc = new OpenIDConnectClient('https://{{YOUR_CRIIPTO_DOMAIN}}',
                                '{{YOUR_CLIENT_ID}}',
                                '{{YOUR_CLIENT_SECRET}}');

$oidc->authenticate();
// Or any other available claim based on your used authentication method: https://docs.criipto.com/verify/e-ids/
$name = $oidc->getVerifiedClaims('name');

Register callback URLs

You will need to register whichever URL you are calling $oidc->authenticate() on as a Callback URL on your Criipto Application.

If you're testing locally using php -S localhost:8000 and a file called auth.php the callback url, as an example, would be https://localhost:8000/auth.php