-
Notifications
You must be signed in to change notification settings - Fork 1
atmosphere_client_metadata
github-actions[bot] edited this page May 27, 2026
·
10 revisions
Filters the OAuth client metadata served at the REST endpoint.
Filters MUST return an array containing:
-
client_id: non-empty string (advertised as the OAuth client identifier; should matchClient::client_id()). -
redirect_uris: non-empty list of non-empty strings, where every entry is rooted at this site's admin over HTTPS (admin_url('', 'https')prefix). Off-site / empty / non-string / HTTP-scheme / nested-array entries cause the entire filter result to be rejected.
Anything else falls back to the unfiltered metadata. The
metadata endpoint is public and the document advertises
token_endpoint_auth_method: 'none' (public client), so an
attacker-supplied redirect_uris entry would let them drive
this site's client_id with their own redirect target. Gate
entries individually, matching the validation
the inbound atmosphere_oauth_redirect_uri filter.
/**
* Filters the OAuth client metadata served at the REST endpoint.
*
* Filters MUST return an array containing:
*
* - `client_id`: non-empty string (advertised as the OAuth client
* identifier; should match `Client::client_id()`).
* - `redirect_uris`: non-empty list of non-empty strings, where
* every entry is rooted at this site's admin over HTTPS
* (`admin_url('', 'https')` prefix). Off-site / empty /
* non-string / HTTP-scheme / nested-array entries cause the
* entire filter result to be rejected.
*
* Anything else falls back to the unfiltered metadata. The
* metadata endpoint is public and the document advertises
* `token_endpoint_auth_method: 'none'` (public client), so an
* attacker-supplied `redirect_uris` entry would let them drive
* this site's `client_id` with their own redirect target. Gate
* entries individually, matching the validation
* the inbound `atmosphere_oauth_redirect_uri` filter.
*
* @param array $metadata
* @return array The filtered value.
*/
function my_atmosphere_client_metadata_callback( array $metadata ) {
// Your code here.
return $metadata;
}
add_filter( 'atmosphere_client_metadata', 'my_atmosphere_client_metadata_callback' );-
array$metadataClient metadata.
\apply_filters( 'atmosphere_client_metadata', $metadata )