ClientCredentialsGrant
trait ClientCredentialsGrant
Traits
Properties
| protected OAuthConfig|null | $oauthConfig | The immutable OAuth 2 configuration. |
from HasOAuthConfig |
Methods
Parse the access token, expiry and data of a token response.
Resolve the scopes reported by the provider.
Resolve an OAuth token expiry.
Cache client-credentials tokens for this grant.
Request a client-credentials access token.
Create an OAuth authenticator from a token response.
Create an OAuth authenticator.
Resolve the client-credentials request.
Details
in
HasOAuthConfig at line 24
OAuthConfig
oauthConfig()
Get the OAuth 2 configuration.
in
HasOAuthConfig at line 32
abstract protected OAuthConfig
defaultOAuthConfig()
Define the default OAuth 2 configuration.
in
ParsesOAuthTokenResponses at line 25
protected array
parseOAuthTokenResponse(Response $response)
Parse the access token, expiry and data of a token response.
in
ParsesOAuthTokenResponses at line 42
protected array|null
resolveOAuthScopes(mixed $scopes)
Resolve the scopes reported by the provider.
in
ParsesOAuthTokenResponses at line 60
protected CarbonImmutable|null
resolveOAuthExpiry(mixed $expiresIn)
Resolve an OAuth token expiry.
at line 34
CachedTokenAuthenticator
cachedAccessToken(array $scopes = [], string $scopeSeparator = ' ', string|null $store = null, callable|null $requestModifier = null, string $key = '')
Cache client-credentials tokens for this grant.
at line 65
OAuthAuthenticator|Response
getAccessToken(array $scopes = [], string $scopeSeparator = ' ', bool $returnResponse = false, callable|null $requestModifier = null)
Request a client-credentials access token.
at line 91
protected OAuthAuthenticator
createOAuthAuthenticatorFromResponse(Response $response)
Create an OAuth authenticator from a token response.
at line 103
protected OAuthAuthenticator
createOAuthAuthenticator(string $accessToken, DateTimeImmutable|null $expiresAt = null, array|null $scopes = null)
Create an OAuth authenticator.
at line 117
protected Request
resolveAccessTokenRequest(OAuthConfig $oauthConfig, array $scopes = [], string $scopeSeparator = ' ')
Resolve the client-credentials request.