class AccessTokenAuthenticator implements OAuthAuthenticator

Methods

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

Create an access token authenticator.

void
set(PendingRequest $pendingRequest)

Apply the authentication to the request.

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.

CarbonInterface|null
getExpiresAt()

Get the expiry.

bool
isRefreshable()

Determine if the authenticator is refreshable.

bool
isNotRefreshable()

Determine if the authenticator is not refreshable.

Details

at line 18
__construct(string $accessToken, string|null $refreshToken = null, CarbonInterface|null $expiresAt = null)

Create an access token authenticator.

Parameters

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

at line 30
void set(PendingRequest $pendingRequest)

Apply the authentication to the request.

Parameters

PendingRequest $pendingRequest

Return Value

void

at line 38
bool hasExpired()

Check if the access token has expired.

Return Value

bool

at line 46
bool hasNotExpired()

Check if the access token has not expired.

Return Value

bool

at line 54
string getAccessToken()

Get the access token.

Return Value

string

at line 62
string|null getRefreshToken()

Get the refresh token.

Return Value

string|null

at line 70
CarbonInterface|null getExpiresAt()

Get the expiry.

Return Value

CarbonInterface|null

at line 78
bool isRefreshable()

Determine if the authenticator is refreshable.

Return Value

bool

at line 86
bool isNotRefreshable()

Determine if the authenticator is not refreshable.

Return Value

bool