trait ClientCredentialsBasicAuthGrant

Traits

Properties

protected OAuthConfig|null $oauthConfig

The immutable OAuth 2 configuration.

from  HasOAuthConfig

Methods

createOAuthAuthenticatorFromResponse(Response $response, string|null $fallbackRefreshToken = null)

Create an OAuth authenticator from a token response.

createOAuthAuthenticator(string $accessToken, string|null $refreshToken = null, CarbonInterface|null $expiresAt = null)

Create an OAuth authenticator.

CarbonInterface|null
resolveOAuthExpiry(mixed $expiresIn)

Resolve an OAuth token expiry.

oauthConfig()

Get the OAuth 2 configuration.

defaultOAuthConfig()

Define the default OAuth 2 configuration.

getAccessToken(array $scopes = [], string $scopeSeparator = ' ', bool $returnResponse = false, callable|null $requestModifier = null)

Request a client-credentials access token.

resolveAccessTokenRequest(OAuthConfig $oauthConfig, array $scopes = [], string $scopeSeparator = ' ')

Resolve the client-credentials request.

Details

protected OAuthAuthenticator createOAuthAuthenticatorFromResponse(Response $response, string|null $fallbackRefreshToken = null)

Create an OAuth authenticator from a token response.

Parameters

Response $response
string|null $fallbackRefreshToken

Return Value

OAuthAuthenticator

protected OAuthAuthenticator createOAuthAuthenticator(string $accessToken, string|null $refreshToken = null, CarbonInterface|null $expiresAt = null)

Create an OAuth authenticator.

Parameters

string $accessToken
string|null $refreshToken
CarbonInterface|null $expiresAt

Return Value

OAuthAuthenticator

protected CarbonInterface|null resolveOAuthExpiry(mixed $expiresIn)

Resolve an OAuth token expiry.

Parameters

mixed $expiresIn

Return Value

CarbonInterface|null

in HasOAuthConfig at line 24
OAuthConfig oauthConfig()

Get the OAuth 2 configuration.

Return Value

OAuthConfig

in HasOAuthConfig at line 32
abstract protected OAuthConfig defaultOAuthConfig()

Define the default OAuth 2 configuration.

Return Value

OAuthConfig

OAuthAuthenticator|Response getAccessToken(array $scopes = [], string $scopeSeparator = ' ', bool $returnResponse = false, callable|null $requestModifier = null)

Request a client-credentials access token.

Parameters

array $scopes
string $scopeSeparator
bool $returnResponse
callable|null $requestModifier

Return Value

OAuthAuthenticator|Response

at line 25
protected Request resolveAccessTokenRequest(OAuthConfig $oauthConfig, array $scopes = [], string $scopeSeparator = ' ')

Resolve the client-credentials request.

Parameters

OAuthConfig $oauthConfig
array $scopes
string $scopeSeparator

Return Value

Request