Yoast\WP\SEO\MyYoast_Client\Infrastructure\Crypto

Client_Authenticator::create_client_assertionpublicYoast 1.0

Creates a signed client_assertion JWT for the given audience.

Метод класса: Client_Authenticator{}

Хуков нет.

Возвращает

Строку. The signed client_assertion JWT.

Использование

$Client_Authenticator = new Client_Authenticator();
$Client_Authenticator->create_client_assertion( $client_id, $audience ): string;
$client_id(строка) (обязательный)
The registered client_id.
$audience(строка) (обязательный)
The audience URL (typically the token endpoint).

Код Client_Authenticator::create_client_assertion() Yoast 28.3

public function create_client_assertion( string $client_id, string $audience ): string {
	try {
		$key_pair = $this->key_pair_manager->get_or_create_key_pair( Key_Pair_Manager::PURPOSE_REGISTRATION );

		return $this->jwt_signer->create_client_assertion( $client_id, $audience, $key_pair );
	} catch ( Encryption_Exception | JWT_Signing_Exception $e ) {
		// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Internal exception message.
		throw new Client_Authentication_Exception( 'Client assertion signing failed: ' . $e->getMessage(), 0, $e );
	}
}