From 7ebfbc91e92bb133beb907c6bde79279ee5156df Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 23 Feb 2024 10:00:10 +0300 Subject: drop refreshtoken related stuff --- init.php | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'init.php') diff --git a/init.php b/init.php index e5590ec..f5731e8 100644 --- a/init.php +++ b/init.php @@ -38,7 +38,6 @@ class Auth_OIDC extends Auth_Base { if (Config::get(self::AUTH_OIDC_URL)) { $host->add_hook($host::HOOK_AUTH_USER, $this); $host->add_hook($host::HOOK_LOGINFORM_ADDITIONAL_BUTTONS, $this); - $host->add_hook($host::HOOK_VALIDATE_SESSION, $this); if (Config::get(self::AUTH_OIDC_POST_LOGOUT_URL) != "") $host->add_hook($host::HOOK_POST_LOGOUT, $this); @@ -93,9 +92,6 @@ class Auth_OIDC extends Auth_Base { } } - $_SESSION["auth_oidc:refresh_token"] = $oidc->getRefreshToken(); - $_SESSION["auth_oidc:refresh_token_last_check"] = time(); - return $user_id; } catch (Exception $e) { @@ -106,30 +102,6 @@ class Auth_OIDC extends Auth_Base { return false; } - function hook_validate_session(): bool { - $refresh_token = $_SESSION["auth_oidc:refresh_token"] ?? false; - - if ($refresh_token && $_SESSION["auth_oidc:refresh_token_last_check"] < time() - Config::get(self::AUTH_OIDC_VALIDATE_INTERVAL)) { - $oidc = new OpenIDConnectClient(Config::get(self::AUTH_OIDC_URL), - Config::get(self::AUTH_OIDC_CLIENT_ID), - Config::get(self::AUTH_OIDC_CLIENT_SECRET)); - - try { - $result = $oidc->introspectToken($refresh_token); - - if ($result->active) - $_SESSION["auth_oidc:refresh_token_last_check"] = time(); - - return $result->active; - } catch (Exception $e) { - $_SESSION["login_error_msg"] = 'OIDC: ' . $e->getMessage(); - return false; - } - } - - return true; - } - function get_login_js() { return file_get_contents(__DIR__ . "/init.js"); } -- cgit v1.2.3