php-sso / oauth-server
OAuth 2.0 and OpenID Connect authorization server for PSR-7 and PSR-15 applications, without third-party runtime dependencies.
v1.0.0
2026-11-21 15:38 UTC
Requires
- php: ^8.2
- ext-json: *
- ext-openssl: *
- psr/clock: ^1.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.1 || ^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- laminas/laminas-diactoros: ^3.0
- lcobucci/jwt: ^5.0
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^11.0 || ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-22 00:31:35 UTC
README
An OAuth 2.0 and OpenID Connect authorization server for PSR-7 / PSR-15 applications.
- PSR-7 messages in and out, PSR-15 request handlers and middleware: it fits any framework.
- No third-party runtime dependencies: only the PSR interface packages and PHP's own
opensslandjson. - Storage, people, clients and keys are interfaces you implement; nothing here knows about your database.
- Small on purpose, and strict by default.
Install
composer require php-sso/oauth-server
PHP 8.2 or newer, with ext-json and ext-openssl.
Documentation
The documentation is at https://php-sso.github.io/oauth-server/:
- What it supports: grants, OpenID Connect, logout, tokens, and what is not there yet.
- Using it: building the server, and what your application has to provide.
- Roles, and APIs behind the server
- Verifying tokens this server did not sign
- Security behaviour and the threat model
The pages are in docs/content, built with Hugo and the
php-sso docs theme. Preview them with hugo server --source docs.
Develop
composer install
composer check # PHPStan (level max, strict rules, no baseline) and PHPUnit
Tests follow Arrange, Act, Assert, one file per method:
tests/unit/PhpSso/OAuthServer/{Namespace}/{Class}/{Method}Test.php.
License
MIT. See LICENSE.