PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.8
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.8
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / myyoast-client / application / ports / id-token-validator-interface.php

id-token-validator-interface.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.8, at src/myyoast-client/application/ports/id-token-validator-interface.php

30 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
4 namespace Yoast\WP\SEO\MyYoast_Client\Application\Ports;
5
6 use Yoast\WP\SEO\MyYoast_Client\Application\Exceptions\Discovery_Failed_Exception;
7 use Yoast\WP\SEO\MyYoast_Client\Application\Exceptions\ID_Token_Validation_Exception;
8 use Yoast\WP\SEO\MyYoast_Client\Application\Exceptions\Server_Capability_Exception;
9
10 /**
11 * Port for OIDC ID token validation.
12 */
13 interface ID_Token_Validator_Interface {
14
15 /**
16 * Validates an ID token.
17 *
18 * @param string $id_token The raw ID token JWT.
19 * @param string $client_id The expected client_id (audience).
20 * @param string $expected_nonce The nonce sent in the authorization request.
21 *
22 * @return array<string, string|int|array<string>> The validated ID token payload (claims).
23 *
24 * @throws ID_Token_Validation_Exception If validation fails.
25 * @throws Discovery_Failed_Exception If the discovery document cannot be fetched.
26 * @throws Server_Capability_Exception If the server lacks required capabilities.
27 */
28 public function validate( string $id_token, string $client_id, string $expected_nonce ): array;
29 }
30