# wordpress-seo/28.1/src/myyoast-client/application/grants/refresh-token-grant.php

Yoast SEO – Advanced SEO with real-time guidance and built-in AI, version 28.1. 55 lines.

- Page: https://pluginprobe.com/plugins/wordpress-seo/28.1/code/src/myyoast-client/application/grants/refresh-token-grant.php
- Raw: https://pluginprobe.com/plugins/wordpress-seo/28.1/raw/src/myyoast-client/application/grants/refresh-token-grant.php
- Modified: 2026-05-12T12:03:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wordpress-seo/28.1/code/src/myyoast-client/application/grants/refresh-token-grant.php#L10-L20`.

```php
<?php
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.

namespace Yoast\WP\SEO\MyYoast_Client\Application\Grants;

use SensitiveParameter;

/**
 * Grant strategy for the Refresh Token flow (RFC 6749 Section 6).
 *
 * Exchanges a refresh token for new access and refresh tokens.
 */
class Refresh_Token_Grant implements Grant_Interface {

	/**
	 * The refresh token.
	 *
	 * @var string
	 */
	private $refresh_token;

	/**
	 * Refresh_Token_Grant constructor.
	 *
	 * @param string $refresh_token The refresh token.
	 */
	public function __construct(
		// phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPNativeAttributeFound -- No-op on PHP < 8.2; redacts parameter from stack traces on PHP 8.2+.
		#[SensitiveParameter]
		string $refresh_token
	) {
		$this->refresh_token = $refresh_token;
	}

	/**
	 * Returns the grant type identifier.
	 *
	 * @return string
	 */
	public function get_grant_type(): string {
		return 'refresh_token';
	}

	/**
	 * Returns the grant-specific parameters.
	 *
	 * @return array<string, string>
	 */
	public function get_grant_params(): array {
		return [
			'refresh_token' => $this->refresh_token,
		];
	}
}

```
