From 13bfd5ad4a6ab33ecab35d933deba01e9de6e404 Mon Sep 17 00:00:00 2001 From: bearn666 Date: Mon, 18 Jul 2022 11:37:00 +0300 Subject: [PATCH] added a request for revoke Apple token (#861) Co-authored-by: atymic --- Provider.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Provider.php b/Provider.php index fad3772..f2abe33 100644 --- a/Provider.php +++ b/Provider.php @@ -241,4 +241,32 @@ private function getUserRequest(): array return json_decode($value, true); } + + /** + * @return string + */ + protected function getRevokeUrl(): string + { + return self::URL.'auth/revoke'; + } + + /** + * @param string $token + * @param string $hint + * + * @throws \GuzzleHttp\Exception\GuzzleException + * + * @return \Psr\Http\Message\ResponseInterface + */ + public function revokeToken(string $token, string $hint = 'access_token') + { + return $this->getHttpClient()->post($this->getRevokeUrl(), [ + RequestOptions::FORM_PARAMS => [ + 'client_id' => $this->clientId, + 'client_secret' => $this->clientSecret, + 'token' => $token, + 'token_type_hint' => $hint, + ], + ]); + } }