28 lines
730 B
PHP
28 lines
730 B
PHP
<?php
|
||
session_start();
|
||
|
||
require __DIR__ . '/../vendor/autoload.php';
|
||
use Jumbojett\OpenIDConnectClient;
|
||
|
||
$config = require __DIR__ . '/../config.php';
|
||
|
||
$oidc = new OpenIDConnectClient(
|
||
$config['provider_url'],
|
||
$config['client_id'],
|
||
$config['client_secret']
|
||
);
|
||
|
||
// Tell the library where to return after the user logs in
|
||
$oidc->setRedirectURL($config['redirect_uri']);
|
||
|
||
// Tell it which scopes we want
|
||
$oidc->addScope($config['scopes']);
|
||
|
||
// The OIDC flow we’ll use
|
||
$oidc->setResponseTypes([$config['response_type']]);
|
||
|
||
// Optional: for local development you can relax TLS validation
|
||
// $oidc->setVerifyHost(false);
|
||
// $oidc->setVerifyPeer(false);
|
||
|
||
$oidc->authenticate(); // This automatically redirects to Authelia
|