PHP code example of rafalmasiarek / dashboard-kit-addon-sso

1. Go to this page and download the library: Download rafalmasiarek/dashboard-kit-addon-sso library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rafalmasiarek / dashboard-kit-addon-sso example snippets


use rafalmasiarek\DashboardKitSso\SsoAddon;

$dashboard = Dashboard::create(__DIR__ . '/../', [
    'sso' => [
        'issuer' => 'https://auth.example.com',
    ],
]);

SsoAddon::register($dashboard->getApp(), $dashboard->getContainer());

$dashboard->run();

use Firebase\JWT\JWT;
use Firebase\JWT\JWK;

$jwks  = json_decode(file_get_contents('https://auth.example.com/oauth/jwks.json'), true);
$keys  = JWK::parseKeySet($jwks);
$payload = JWT::decode($accessToken, $keys);