final class OAuthConfig

Properties

null|Request): void $requestModifier

The request modifier.

Methods

__construct(string $clientId, string $clientSecret, string $redirectUri = '', string $authorizeEndpoint = 'authorize', string $tokenEndpoint = 'token', string|null $refreshEndpoint = null, string $userEndpoint = 'user', array $defaultScopes = [], callable|null $requestModifier = null, bool $allowBaseUrlOverride = false)

Create an OAuth 2 configuration.

array
scopes(array $scopes = [])

Merge the default scopes with the given scopes, ignoring null and empty scopes.

modify(Request $request)

Apply the configured request modifier.

bool
validate(bool $withRedirectUrl = true)

Validate the OAuth 2 configuration.

Details

at line 27
__construct(string $clientId, string $clientSecret, string $redirectUri = '', string $authorizeEndpoint = 'authorize', string $tokenEndpoint = 'token', string|null $refreshEndpoint = null, string $userEndpoint = 'user', array $defaultScopes = [], callable|null $requestModifier = null, bool $allowBaseUrlOverride = false)

Create an OAuth 2 configuration.

Parameters

string $clientId
string $clientSecret
string $redirectUri
string $authorizeEndpoint
string $tokenEndpoint
string|null $refreshEndpoint
string $userEndpoint
array $defaultScopes
callable|null $requestModifier
bool $allowBaseUrlOverride

at line 49
array scopes(array $scopes = [])

Merge the default scopes with the given scopes, ignoring null and empty scopes.

Parameters

array $scopes

Return Value

array

at line 64
Request modify(Request $request)

Apply the configured request modifier.

Parameters

Request $request

Return Value

Request

at line 76
bool validate(bool $withRedirectUrl = true)

Validate the OAuth 2 configuration.

Parameters

bool $withRedirectUrl

Return Value

bool

Exceptions

OAuthConfigValidationException