<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
//phpinfo();
// Include the SimpleSAMLphp autoload file
require_once 'vendor/autoload.php';

// Initialize SimpleSAMLphp
$auth = new \SimpleSAML\Auth\Simple('default-sp');

// Check if the user is authenticated
if (!$auth->isAuthenticated()) {
    // Redirect the user to the IdP for authentication
    $auth->login();
} else {
    // User is authenticated, get user attributes
    $attributes = $auth->getAttributes();
//     $attributes = [
//     'email' => 'user@example.com',
//     'name' => 'John Doe',
//     // Add more attributes as needed
// ];
    // Do something with the user attributes
    var_dump($attributes);
}