setVerifyPeer(false); // <-- DO NOT USE IN PRODUCTION // PKCE – optional but recommended for public clients $oidc->setCodeChallengeMethod('S256'); // Tell the client where to land after Auth $oidc->setRedirectURL('https://fitness.matt-cloud.com/pgapi/auth/oidc/callback'); // Optional: hard‑code the discovery URL $oidc->setDiscoveryEndpoint('https://auth.matt-cloud.com/.well-known/openid-configuration'); try { $oidc->authenticate(); // sends 302 → Authelia } catch (Exception $e) { http_response_code(500); echo 'Login failed: ' . $e->getMessage(); exit; }