25 lines
701 B
PHP
25 lines
701 B
PHP
<?php
|
|
// login.php
|
|
require __DIR__ . '/vendor/autoload.php';
|
|
session_start();
|
|
|
|
$oidc = new \Jumbojett\OpenIDConnectClient(
|
|
'https://auth.matt-cloud.com/oidc',
|
|
'fitness-oidc',
|
|
'egebuqzZfVnjjBG9JDQ8tjW3TzV9gJurvT7qfB6c2SX2nPBNeaGycDfx4788QzJd'
|
|
);
|
|
|
|
// Tell the client where the user should be redirected after Auth
|
|
$oidc->setRedirectURL('https://fitness.matt-cloud.com/pgapi/auth/oidc/callback');
|
|
|
|
// If you want PKCE (recommended for public clients)
|
|
$oidc->setCodeChallengeMethod('S256');
|
|
|
|
// Start the auth flow
|
|
try {
|
|
$oidc->authenticate(); // will redirect to Authelia
|
|
} catch (Exception $e) {
|
|
http_response_code(500);
|
|
echo 'Login failed: ' . $e->getMessage();
|
|
exit;
|
|
} |