-
Notifications
You must be signed in to change notification settings - Fork 2
OAuth2Client
Viames Marino edited this page Feb 23, 2026
·
1 revision
Pair\Models\OAuth2Client manages OAuth2 client credentials and token issuance.
issueAccessToken(): stringsendAccessTokenResponse(): void
Lifecycle/config:
-
_init()defines fields and validation rules
$client = \Pair\Models\OAuth2Client::findByClientId($clientId);
if (!$client || !$client->active) {
throw new RuntimeException('Invalid client');
}
$token = $client->issueAccessToken();- Designed for server-to-server OAuth flows.
-
sendAccessTokenResponse()writes standardized token payload output.
See also: OAuth2Token, ApiController.