Documentation

OAuth2RefreshMiddleware extends AbstractMiddleware
in package

Middleware for automatic OAuth token refresh on 401 responses

Table of Contents

Properties

$config  : array{auto_refresh: bool, retry_on_401: bool}

Methods

__construct()  : mixed
__invoke()  : callable
Create the middleware handler.
configure()  : void
Configure the middleware.
getName()  : string
Get the middleware name.
getConfig()  : mixed
Get a configuration value
getDefaultConfig()  : array<string, mixed>
Get default configuration for the middleware

Properties

$config

protected array{auto_refresh: bool, retry_on_401: bool} $config = ['auto_refresh' => true, 'retry_on_401' => true]

Methods

__construct()

public __construct([array<string, mixed> $config = [] ]) : mixed
Parameters
$config : array<string, mixed> = []

configure()

Configure the middleware.

public configure(array{auto_refresh?: bool, retry_on_401?: bool} $config) : void
Parameters
$config : array{auto_refresh?: bool, retry_on_401?: bool}

getConfig()

Get a configuration value

protected getConfig(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null

getDefaultConfig()

Get default configuration for the middleware

protected getDefaultConfig() : array<string, mixed>
Return values
array<string, mixed>

        
On this page

Search results