ProtectedResourceMetadata implements JsonSerializable
FinalYes
OAuth 2.0 Protected Resource Metadata (RFC 9728).
Tags
Table of Contents
Interfaces
- JsonSerializable
Constants
- DEFAULT_METADATA_PATH = '/.well-known/oauth-protected-resource'
- LOCALIZED_HUMAN_READABLE_FIELD_PATTERN = '/^(resource_name|resource_documentation|resource_policy_uri|resource_tos_uri)#[A-Za-z0-9-]+$/'
Properties
- $authorizationServers : array<int, string>
- $extra : array<string, mixed>
- $localizedHumanReadable : array<string, string>
- $metadataPaths : array<int, string>
- $resource : string|null
- $resourceDocumentation : string|null
- $resourceName : string|null
- $resourcePolicyUri : string|null
- $resourceTosUri : string|null
- $scopesSupported : array<int, string>|null
Methods
- __construct() : mixed
- getMetadataPaths() : array<int, string>
- getPrimaryMetadataPath() : string
- getScopesSupported() : array<int, string>|null
- jsonSerialize() : array<string, mixed>
- normalizeLocalizedHumanReadable() : array<string, string>
- normalizeNullableString() : string|null
- normalizePaths() : array<int, string>
- normalizeStringList() : array<int, string>
Constants
DEFAULT_METADATA_PATH
public
mixed
DEFAULT_METADATA_PATH
= '/.well-known/oauth-protected-resource'
LOCALIZED_HUMAN_READABLE_FIELD_PATTERN
private
mixed
LOCALIZED_HUMAN_READABLE_FIELD_PATTERN
= '/^(resource_name|resource_documentation|resource_policy_uri|resource_tos_uri)#[A-Za-z0-9-]+$/'
Properties
$authorizationServers
private
array<int, string>
$authorizationServers
$extra
private
array<string, mixed>
$extra
$localizedHumanReadable
private
array<string, string>
$localizedHumanReadable
$metadataPaths
private
array<int, string>
$metadataPaths
$resource
private
string|null
$resource
$resourceDocumentation
private
string|null
$resourceDocumentation
$resourceName
private
string|null
$resourceName
$resourcePolicyUri
private
string|null
$resourcePolicyUri
$resourceTosUri
private
string|null
$resourceTosUri
$scopesSupported
private
array<int, string>|null
$scopesSupported
Methods
__construct()
public
__construct(array<int, string> $authorizationServers[, array<int, string>|null $scopesSupported = null ][, string|null $resource = null ][, string|null $resourceName = null ][, string|null $resourceDocumentation = null ][, string|null $resourcePolicyUri = null ][, string|null $resourceTosUri = null ][, array<string, string> $localizedHumanReadable = [] ][, array<string, mixed> $extra = [] ][, array<int, string> $metadataPaths = [self::DEFAULT_METADATA_PATH] ]) : mixed
Parameters
- $authorizationServers : array<int, string>
- $scopesSupported : array<int, string>|null = null
- $resource : string|null = null
- $resourceName : string|null = null
- $resourceDocumentation : string|null = null
- $resourcePolicyUri : string|null = null
- $resourceTosUri : string|null = null
- $localizedHumanReadable : array<string, string> = []
-
Locale-specific values, e.g. resource_name#en => "My Resource"
- $extra : array<string, mixed> = []
-
Additional RFC 9728 metadata fields
- $metadataPaths : array<int, string> = [self::DEFAULT_METADATA_PATH]
getMetadataPaths()
public
getMetadataPaths() : array<int, string>
Return values
array<int, string>getPrimaryMetadataPath()
public
getPrimaryMetadataPath() : string
Return values
stringgetScopesSupported()
public
getScopesSupported() : array<int, string>|null
Return values
array<int, string>|nulljsonSerialize()
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>normalizeLocalizedHumanReadable()
private
normalizeLocalizedHumanReadable(array<string, string> $localizedHumanReadable) : array<string, string>
Parameters
- $localizedHumanReadable : array<string, string>
Return values
array<string, string>normalizeNullableString()
private
normalizeNullableString(string|null $value) : string|null
Parameters
- $value : string|null
Return values
string|nullnormalizePaths()
private
normalizePaths(array<int, string> $paths) : array<int, string>
Parameters
- $paths : array<int, string>
Return values
array<int, string>normalizeStringList()
private
normalizeStringList(array<int, string> $values, string $parameterName) : array<int, string>
Parameters
- $values : array<int, string>
- $parameterName : string