MCP PHP SDK

HeadlessAuthorizationHandler implements AuthorizationHandlerInterface

FinalYes

Requests the authorization endpoint itself and reads the code from the redirect, for servers that grant without a prompt.

Tags
author

Christopher Hertel mail@christopher-hertel.de

Table of Contents

Interfaces

AuthorizationHandlerInterface
Takes the user to the authorization endpoint and returns the answer of the authorization server.

Properties

$httpClient  : ClientInterface
$logger  : LoggerInterface
$requestFactory  : RequestFactoryInterface

Methods

__construct()  : mixed
authorize()  : array<string, string>
Send the user to $authorizationUrl and return the query parameters of the redirect to $redirectUri, unchecked.
fetchRedirect()  : string

Properties

Methods

__construct()

public __construct([ClientInterface|null $httpClient = null ][, RequestFactoryInterface|null $requestFactory = null ][, LoggerInterface $logger = new NullLogger() ]) : mixed
Parameters
$httpClient : ClientInterface|null = null

the client for the request, which must not follow redirects, so pass the one given to OAuth::setHttpClient()

$requestFactory : RequestFactoryInterface|null = null
$logger : LoggerInterface = new NullLogger()

authorize()

Send the user to $authorizationUrl and return the query parameters of the redirect to $redirectUri, unchecked.

public authorize(string $authorizationUrl, string $redirectUri) : array<string, string>
Parameters
$authorizationUrl : string
$redirectUri : string
Return values
array<string, string> —

the callback's query parameters

On this page

Search results