MCP PHP SDK

ClientRegistration implements JsonSerializable

FinalYes

The client's identity at one authorization server.

Tags
author

Christopher Hertel mail@christopher-hertel.de

Table of Contents

Interfaces

JsonSerializable

Properties

$clientId  : string
$clientSecret  : string|null
$clientSecretExpiresAt  : int|null
$dynamic  : bool
$redirectUris  : array<string|int, mixed>
$scopes  : array<string|int, mixed>|null
$tokenEndpointAuthMethod  : TokenEndpointAuthMethod

Methods

__construct()  : mixed
fromArray()  : self
fromResponse()  : self
Build a registration from a parsed RFC 7591 registration response.
isExpired()  : bool
jsonSerialize()  : array<string, mixed>
authMethod()  : TokenEndpointAuthMethod|null

Properties

Methods

__construct()

public __construct(string $clientId[, string|null $clientSecret = null ][, TokenEndpointAuthMethod $tokenEndpointAuthMethod = TokenEndpointAuthMethod::None ][, bool $dynamic = false ][, int|null $clientSecretExpiresAt = null ][, array<string|int, string> $redirectUris = [] ][, array<string|int, string>|null $scopes = null ]) : mixed
Parameters
$clientId : string

the client identifier

$clientSecret : string|null = null

the client secret, when the server issued one

$tokenEndpointAuthMethod : TokenEndpointAuthMethod = TokenEndpointAuthMethod::None

how the client authenticates at the token endpoint

$dynamic : bool = false

whether this came from dynamic client registration, and may therefore be re-created at will

$clientSecretExpiresAt : int|null = null

unix timestamp the secret expires at, 0/null when it does not

$redirectUris : array<string|int, string> = []

the redirect URIs this client was registered with, empty when unknown

$scopes : array<string|int, string>|null = null

the scopes this client was registered for, null when it named none

fromArray()

public static fromArray(array<string, mixed> $data) : self
Parameters
$data : array<string, mixed>
Return values
self

fromResponse()

Build a registration from a parsed RFC 7591 registration response.

public static fromResponse(array<string, mixed> $response[, TokenEndpointAuthMethod $fallback = TokenEndpointAuthMethod::None ][, array<string|int, string> $redirectUris = [] ][, array<string|int, string>|null $scopes = null ]) : self
Parameters
$response : array<string, mixed>

the parsed registration response

$fallback : TokenEndpointAuthMethod = TokenEndpointAuthMethod::None

the method to assume when the server does not echo one back

$redirectUris : array<string|int, string> = []

the redirect URIs that were registered

$scopes : array<string|int, string>|null = null

the scopes that were registered

Return values
self

isExpired()

public isExpired([int|null $now = null ]) : bool
Parameters
$now : int|null = null
Return values
bool

jsonSerialize()

public jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>
On this page

Search results