OAuth2Client - viames/pair GitHub Wiki
Pair framework: OAuth2Client
Pair\Models\OAuth2Client manages OAuth2 client credentials and token issuance.
Main methods
issueAccessToken(): stringsendAccessTokenResponse(): void
Lifecycle/config:
_init()defines fields and validation rules
Implementation example
$client = \Pair\Models\OAuth2Client::findByClientId($clientId);
if (!$client || !$client->active) {
throw new RuntimeException('Invalid client');
}
$token = $client->issueAccessToken();
Notes
- Designed for server-to-server OAuth flows.
sendAccessTokenResponse()writes standardized token payload output.
See also: OAuth2Token, ApiController.