cicnavi / oidc-client-php
OIDC client written in PHP
v3.4.0
2026-07-04 12:33 UTC
Requires
- php: ^8.2
- ext-gmp: *
- ext-json: *
- ext-openssl: *
- cicnavi/simple-file-cache-php: ^3
- guzzlehttp/guzzle: ^7.8
- psr/http-client: ^1
- psr/http-factory: ^1
- psr/http-message: ^2
- psr/log: ^3
- psr/simple-cache: ^3
- simplesamlphp/openid: ^v0.3.2
Requires (Dev)
- ext-xdebug: *
- phpstan/phpstan: ^2
- phpunit/phpunit: ^11
- rector/rector: ^2
- squizlabs/php_codesniffer: ^3
Conflicts
- rector/rector: 2.3.0
README
A PHP OpenID Connect Relying Party client for applications that need to authenticate users through an OpenID Provider using Authorization Code Flow.
It is built for practical OIDC integrations: provider discovery, JWKS key
rotation, ID token validation, user claims extraction, userinfo fetching,
PKCE, Pushed Authorization Requests, RP-Initiated and Back-Channel Logout,
and cache-backed metadata/key handling are included.
What It Supports
- Pre-registered OIDC clients with an existing client ID and secret
- Federated clients using OpenID Federation automatic client registration
- Dynamic Client Registration for providers that support it
- Authorization Code Flow with state, nonce, PKCE, ID token validation, and user data fetching
- JWKS discovery, public key rollover, and file-based caching by default
- RP-Initiated and Back-Channel Logout
Installation
composer require cicnavi/oidc-client-php
Getting Started
Choose the setup that matches your OpenID Provider:
- Pre-registered Client - use this when your client is already registered with the provider.
- Federated Client - use this in OpenID Federation environments.
- Dynamically Registered Client - use this when the provider supports Dynamic Client Registration.
For prerequisites, examples, SameSite cookie notes, and testing instructions, see the full documentation.