friendship ended with social-app. php is my new best friend
1<?php
2/**
3 * Interface TokenInvalidate
4 *
5 * @created 12.02.2023
6 * @author smiley <smiley@chillerlan.net>
7 * @copyright 2023 smiley
8 * @license MIT
9 */
10declare(strict_types=1);
11
12namespace chillerlan\OAuth\Core;
13
14/**
15 * Indicates whether the provider is capable of invalidating access tokens (RFC-7009 or proprietary)
16 *
17 * @link https://datatracker.ietf.org/doc/html/rfc7009
18 */
19interface TokenInvalidate{
20
21 /**
22 * Allows to invalidate an access token
23 *
24 * Clients shall set the optional OAuthProvider::$revokeURL for use in this method.
25 * If a token is given via $token, that token should be invalidated,
26 * otherwise the current user token from the internal storage should be used.
27 * Returns true if the operation was successful, false otherwise.
28 * May throw a ProviderException if an error occurred.
29 *
30 * @see \chillerlan\OAuth\Core\OAuthProvider::$revokeURL
31 *
32 * @throws \chillerlan\OAuth\Providers\ProviderException
33 */
34 public function invalidateAccessToken(AccessToken|null $token = null, string|null $type = null):bool;
35
36}