You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -101,16 +102,17 @@ public function __construct(
101
102
*
102
103
* Generates PKCE challenge, state, and nonce, and stores them in the expiring store.
103
104
*
104
-
* @param int $user_id The WordPress user ID.
105
-
* @param string $redirect_uri The callback redirect URI.
106
-
* @param string[] $scopes The scopes to request.
107
-
* @param string|null $return_url The URL to return the user to after authorization completes.
105
+
* @param int $user_id The WordPress user ID.
106
+
* @param string $redirect_uri The callback redirect URI.
107
+
* @param string[] $scopes The scopes to request.
108
+
* @param Resource_Indicator $resource_indicator The RFC 8707 resource indicator the issued token should be bound to.
109
+
* @param string|null $return_url The URL to return the user to after authorization completes.
108
110
*
109
111
* @return string The authorization URL to redirect the user to.
110
112
*
111
113
* @throws Authorization_Flow_Exception If any of the auth flow prerequisites (registration, discovery, random number generation, or state parameter validation) fails.
@@ -238,21 +242,24 @@ public function exchange_authorization_code( int $user_id, string $code, string
238
242
/**
239
243
* Returns a valid site-level access token (client_credentials).
240
244
*
241
-
* @param string[] $scopes The service:* scopes to request.
245
+
* @param string[] $scopes The service:* scopes to request.
246
+
* @param string|null $resource_indicator The RFC 8707 resource indicator the token should be bound to, or null for the default resource.
242
247
*
243
248
* @return Token_Set The site-level token set.
244
249
*
245
-
* @throws Token_Request_Failed_Exception If the token request fails.
246
-
* @throws Token_Storage_Exception If encrypting the token set for storage fails.
250
+
* @throws Invalid_Resource_Exception If the resource indicator is malformed.
251
+
* @throws Token_Request_Failed_Exception If the token request fails. May also throw Token_Storage_Exception when encrypting the token set for storage fails.
* Executes a token endpoint request using the provided grant strategy.
82
83
*
83
84
* Ensures the client is registered, creates a client assertion, merges
84
-
* grant-specific parameters, and sends the request.
85
+
* grant-specific parameters, and sends the request. The resource indicator
86
+
* is added to the body (unless it's the default-resource instance) and
87
+
* stamped onto the resulting Token_Set so storage and audit code can
88
+
* introspect the audience.
85
89
*
86
-
* @param Grant_Interface $grant The grant strategy providing grant-specific parameters.
90
+
* @param Grant_Interface $grant The grant strategy providing grant-specific parameters.
91
+
* @param Resource_Indicator $resource_indicator The resource indicator (RFC 8707) the grant targets. Use Resource_Indicator::default() for the default resource.
87
92
*
88
93
* @return Token_Set The token set from the response.
89
94
*
90
95
* @throws Token_Request_Failed_Exception If the token request fails.
0 commit comments