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; }