abstract class AbstractProvider

Base class for all federated login providers.

Provides protocol-agnostic infrastructure: HTTP client, request handling, coroutine-safe configuration, state management, and custom parameters. Protocol-specific subclasses (OAuth2, SAML2, etc.) extend this.

Traits

Properties

protected string|null $contextNamespace

The unique context namespace for this provider instance.

from  HasProviderContext
protected array $parameters

The custom parameters to be sent with the request.

protected bool $stateless

Indicates if the session state should be utilized.

protected array $additionalConfig

The provider's baseline configuration.

Methods

mixed
getContext(string $key, mixed $default = null)

No description

mixed
setContext(string $key, mixed $value)

No description

mixed
getOrSetContext(string $key, mixed $value)

No description

string
getContextKey(string $key)

No description

__construct(Request $request, array $guzzle = [])

Create a new provider instance.

withConfig(array $config)

Set the baseline provider configuration.

setConfig(array $config)

Override provider configuration for the current request.

mixed
getConfig(string|null $key = null, mixed $default = null)

Get a value from the provider configuration.

Client
getHttpClient()

Get an instance of the Guzzle HTTP client.

setHttpClient(Client $client)

Set the Guzzle HTTP client instance.

setRequest(Request $request)

Set the request instance.

getRequest()

Get the request instance.

bool
usesState()

Determine if the provider is operating with state.

bool
isStateless()

Determine if the provider is operating as stateless.

stateless()

Indicate that the provider should operate as stateless.

string
getState()

Get the string used for session state.

with(array $parameters)

Set the custom parameters of the request.

array
getParameters()

Get the custom parameters of the request.

Details

in HasProviderContext at line 19
mixed getContext(string $key, mixed $default = null)

No description

Parameters

string $key
mixed $default

Return Value

mixed

in HasProviderContext at line 24
mixed setContext(string $key, mixed $value)

No description

Parameters

string $key
mixed $value

Return Value

mixed

in HasProviderContext at line 29
mixed getOrSetContext(string $key, mixed $value)

No description

Parameters

string $key
mixed $value

Return Value

mixed

in HasProviderContext at line 34
protected string getContextKey(string $key)

No description

Parameters

string $key

Return Value

string

at line 45
__construct(Request $request, array $guzzle = [])

Create a new provider instance.

Parameters

Request $request
array $guzzle

at line 58
AbstractProvider withConfig(array $config)

Set the baseline provider configuration.

Called once at registration time (e.g. from a builder or an extend callback). Writes to the instance property so config survives across coroutines. For per-request overrides, use setConfig() instead.

Parameters

array $config

Return Value

AbstractProvider

at line 71
AbstractProvider setConfig(array $config)

Override provider configuration for the current request.

Writes to coroutine context for Swoole safety. Merges with the current effective config so partial overrides preserve baseline keys.

Parameters

array $config

Return Value

AbstractProvider

at line 83
protected mixed getConfig(string|null $key = null, mixed $default = null)

Get a value from the provider configuration.

Reads per-request context first, falls back to baseline instance property.

Parameters

string|null $key
mixed $default

Return Value

mixed

at line 93
protected Client getHttpClient()

Get an instance of the Guzzle HTTP client.

Return Value

Client

at line 103
AbstractProvider setHttpClient(Client $client)

Set the Guzzle HTTP client instance.

Parameters

Client $client

Return Value

AbstractProvider

at line 116
AbstractProvider setRequest(Request $request)

Set the request instance.

Stores the request in coroutine context so cached providers read the current request without leaking it to concurrent coroutines.

Parameters

Request $request

Return Value

AbstractProvider

at line 126
protected Request getRequest()

Get the request instance.

Return Value

Request

at line 135
protected bool usesState()

Determine if the provider is operating with state.

Return Value

bool

at line 143
protected bool isStateless()

Determine if the provider is operating as stateless.

Return Value

bool

at line 151
AbstractProvider stateless()

Indicate that the provider should operate as stateless.

Return Value

AbstractProvider

at line 161
protected string getState()

Get the string used for session state.

Return Value

string

at line 169
AbstractProvider with(array $parameters)

Set the custom parameters of the request.

Parameters

array $parameters

Return Value

AbstractProvider

at line 179
protected array getParameters()

Get the custom parameters of the request.

Return Value

array