Repository navigation
OAuth2
Pair\Api\OAuth2 provides storage-independent RFC 6749 protocol helpers.
-
decode(string $value): string: form decoding with complete percent escapes and valid UTF-8. -
parameters(string $body): array: reject repeated parameter names; treat empty values as omitted. Retained unknown fields must be ignored by callers unless an explicitly supported extension recognizes them. -
clientCredentials(?string $header): ?array: strict Basic parsing followed by one form decode per component, without credential trimming. -
tokenPayload(string $token, int $lifetime, ?string $scope = null): array: positive expiry, Bearer token, optional nonempty scope; never scope=null or refresh token. -
errorPayload(string $code, ?string $description = null): array: token-endpoint codes and the ASCII character set required for error_description.temporarily_unavailableis not a base token-endpoint error. -
tokenResponse(...)anderrorResponse(...): explicitJsonResponse, mandatory no-store/no-cache headers protected against case-insensitive overrides. Invalid client authentication produces 401 with a Basic challenge; other OAuth errors use 400.
Transport, availability and rate-limit errors are ordinary HTTP errors; use Problem Details separately. Client authentication, scope grants, TLS, abuse prevention and resource ownership remain the application's responsibilities. No new database table or configuration variable is required.
These helpers and the related HTTP fixes are in the current development source; they are not implicitly present in the existing 4.1.4 package. Consumers must install a release containing them or apply the reviewed compatibility patch.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js, PairMotion.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4