AccessTokenAuthenticator
class AccessTokenAuthenticator implements OAuthAuthenticator
Methods
__construct(string $accessToken, string|null $refreshToken = null, DateTimeImmutable|null $expiresAt = null, array|null $scopes = null)
Create an access token authenticator.
void
bool
hasExpired()
Check if the access token has expired.
bool
hasNotExpired()
Check if the access token has not expired.
string
getAccessToken()
Get the access token.
string|null
getRefreshToken()
Get the refresh token.
DateTimeImmutable|null
getExpiresAt()
Get the expiry.
array|null
getScopes()
Get the reported scopes.
bool
isRefreshable()
Determine if the authenticator is refreshable.
bool
isNotRefreshable()
Determine if the authenticator is not refreshable.
Details
at line 20
__construct(string $accessToken, string|null $refreshToken = null, DateTimeImmutable|null $expiresAt = null, array|null $scopes = null)
Create an access token authenticator.
at line 33
void
set(PendingRequest $pendingRequest)
Apply the authentication to the request.
at line 41
bool
hasExpired()
Check if the access token has expired.
at line 49
bool
hasNotExpired()
Check if the access token has not expired.
at line 57
string
getAccessToken()
Get the access token.
at line 65
string|null
getRefreshToken()
Get the refresh token.
at line 73
DateTimeImmutable|null
getExpiresAt()
Get the expiry.
at line 83
array|null
getScopes()
Get the reported scopes.
at line 91
bool
isRefreshable()
Determine if the authenticator is refreshable.
at line 99
bool
isNotRefreshable()
Determine if the authenticator is not refreshable.