From 9ddad5e1955417e07f7850aa5c9dda929e8ea537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B7=BB=E7=BF=BC=20XuTianyi=EF=BC=88xXutianyi?= =?UTF-8?q?=EF=BC=89?= Date: Fri, 22 Dec 2023 21:54:27 +0800 Subject: [PATCH] Update AuthClient.php --- src/Auth/AuthClient.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Auth/AuthClient.php b/src/Auth/AuthClient.php index e5c2359..9e9c7b7 100644 --- a/src/Auth/AuthClient.php +++ b/src/Auth/AuthClient.php @@ -45,6 +45,18 @@ public function getAccessTokenByCode(string $code) return SimpleRequest::post($url, [], $body, [], false); } + public function introspectToken(string $token) + { + $url = $this->options->appHost . "/oidc/token/introspection"; + $body = [ + 'client_id' => $this->options->appId, + 'client_secret' => $this->options->appSecret, + 'token' => $token + ]; + + return SimpleRequest::post($url, [], $body, [], false); + } + public function revokeToken(string $token) { $url = $this->options->appHost . "/oidc/token/revocation"; @@ -81,6 +93,6 @@ public function getUserInfoByAccessToken(string $accessToken, bool $withCustomDa 'Authorization' => "Bearer $accessToken" ]; - return SimpleRequest::post($url, [], $body, $headers,false); + return SimpleRequest::post($url, [], $body, $headers, false); } }