AbstractProvider
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
Set the baseline provider configuration.
Override provider configuration for the current request.
Get a value from the provider configuration.
Get an instance of the Guzzle HTTP client.
Set the Guzzle HTTP client instance.
Get the request instance.
Determine if the provider is operating with state.
Determine if the provider is operating as stateless.
Indicate that the provider should operate as stateless.
Get the string used for session state.
Set the custom parameters of the request.
Get the custom parameters of the request.
Details
in
HasProviderContext at line 19
mixed
getContext(string $key, mixed $default = null)
No description
in
HasProviderContext at line 24
mixed
setContext(string $key, mixed $value)
No description
in
HasProviderContext at line 29
mixed
getOrSetContext(string $key, mixed $value)
No description
in
HasProviderContext at line 34
protected string
getContextKey(string $key)
No description
at line 45
__construct(Request $request, array $guzzle = [])
Create a new provider instance.
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.
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.
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.
at line 93
protected Client
getHttpClient()
Get an instance of the Guzzle HTTP client.
at line 103
AbstractProvider
setHttpClient(Client $client)
Set the Guzzle HTTP client instance.
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.
at line 126
protected Request
getRequest()
Get the request instance.
at line 135
protected bool
usesState()
Determine if the provider is operating with state.
at line 143
protected bool
isStateless()
Determine if the provider is operating as stateless.
at line 151
AbstractProvider
stateless()
Indicate that the provider should operate as stateless.
at line 161
protected string
getState()
Get the string used for session state.
at line 169
AbstractProvider
with(array $parameters)
Set the custom parameters of the request.
at line 179
protected array
getParameters()
Get the custom parameters of the request.