Download the PHP package gpht/oidc without Composer
On this page you can find all versions of the php package gpht/oidc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package oidc
OIDC Library
A PHP library for OpenID Connect (OIDC) integration with AWS Cognito support and Symfony Security component integration.
Features
- OIDC Client Credentials Flow: Machine-to-machine authentication with AWS Cognito
- PSR-6 Token Caching: Built-in token caching with expiration handling for performance
- Symfony Security Integration: User provider for OIDC-based authentication
- Type Safety: Full PHP 8.3+ type annotations with Psalm static analysis
- Modern PHP: Uses readonly classes, strict types, and latest PHP features
Requirements
- PHP 8.3 or higher
- Symfony 6.4+ or 7.0+
Installation
Usage
1. OIDC Client Token (Machine-to-Machine Authentication)
Use OidcClientToken to obtain access tokens for machine-to-machine communication:
Token Caching Benefits
The library automatically caches tokens with the following features:
- Automatic Expiration: Tokens are cached with their expiration time minus a 60-second buffer
- Scope-Based Caching: Different token scopes are cached separately using unique cache keys
- Performance: Reduces HTTP requests to the token endpoint by reusing valid cached tokens
- PSR-6 Compatible: Works with any PSR-6 cache implementation (Redis, Memcached, File system, etc.)
2. Symfony Service Configuration
Register Services
Configure the OIDC services in your Symfony service configuration:
Environment Variables
Add these environment variables to your .env file:
3. Symfony Security Integration
Configure User Provider
Use in Controllers
4. Testing with Client Credentials
Development
Architecture
Gpht\Oidc\Client\OidcClientToken: Handles OAuth2 client credentials flow for machine-to-machine authentication with PSR-6 token cachingGpht\Oidc\Symfony\OidcUserProvider: Symfony Security user provider that createsOidcUserobjects from OIDC claims
Dependencies
The library uses modern PHP standards and minimal dependencies:
- nyholm/psr7: PSR-7 HTTP message implementation for requests
- psr/cache: PSR-6 caching interface for token storage
- psr/http-client: PSR-18 HTTP client interface
- symfony/security-core: Symfony Security component integration
License
MIT License. See LICENSE for details.
All versions of oidc with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.3
nyholm/psr7 Version ^1.8
psr/cache Version ^3.0
psr/http-client Version ^1.0
symfony/security-core Version ^6.4|^7.0
nyholm/psr7 Version ^1.8
psr/cache Version ^3.0
psr/http-client Version ^1.0
symfony/security-core Version ^6.4|^7.0
The package gpht/oidc contains the following files
Loading the files please wait ...