Skip to content

Commit

Permalink
added a request for revoke Apple token (#861)
Browse files Browse the repository at this point in the history
Co-authored-by: atymic <[email protected]>
  • Loading branch information
bearn777 and atymic authored Jul 18, 2022
1 parent b34e195 commit 13bfd5a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
]);
}
}

0 comments on commit 13bfd5a

Please sign in to comment.