league / oauth2-server
A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.
Fund package maintenance!
sephster
Installs: 97 741 777
Dependents: 263
Suggesters: 4
Security: 1
Stars: 6 547
Watchers: 208
Forks: 1 118
Open Issues: 88
Requires
- php: ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0
- ext-json: *
- ext-openssl: *
- defuse/php-encryption: ^2.4
- lcobucci/clock: ^2.3 || ^3.0
- lcobucci/jwt: ^5.0
- league/event: ^3.0
- league/uri: ^7.0
- psr/http-message: ^2.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- laminas/laminas-diactoros: ^3.5
- php-parallel-lint/php-parallel-lint: ^1.3.2
- phpstan/extension-installer: ^1.3.1
- phpstan/phpstan: ^1.12
- phpstan/phpstan-deprecation-rules: ^1.1.4
- phpstan/phpstan-phpunit: ^1.3.15
- phpstan/phpstan-strict-rules: ^1.5.2
- phpunit/phpunit: ^9.6.21
- roave/security-advisories: dev-master
- slevomat/coding-standard: ^8.14.1
- squizlabs/php_codesniffer: ^3.8
Replaces
- league/oauth2server: *
- lncd/oauth2: *
- dev-master
- 9.1.0
- 9.0.1
- 9.0.0
- 9.0.0-RC1
- 8.5.x-dev
- 8.5.5
- 8.5.4
- 8.5.3
- 8.5.2
- 8.5.1
- 8.5.0
- 8.4.x-dev
- 8.4.3
- 8.4.2
- 8.4.1
- 8.4.0
- 8.3.6
- 8.3.5
- 8.3.4
- 8.3.3
- 8.3.2
- 8.3.1
- 8.3.0
- 8.2.4
- 8.2.3
- 8.2.2
- 8.2.1
- 8.2.0
- 8.1.1
- 8.1.0
- 8.0.0
- 7.4.0
- 7.3.x-dev
- 7.3.3
- 7.3.2
- 7.3.1
- 7.3.0
- 7.2.0
- 7.1.1
- 7.1.0
- 7.0.0
- 6.1.1
- 6.1.0
- 6.0.2
- 6.0.1
- 6.0.0
- 5.1.x-dev
- 5.1.6
- 5.1.5
- 5.1.4
- 5.1.3
- 5.1.2
- 5.1.1
- 5.1.0
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 5.0.0-RC2
- 5.0.0-RC1
- 4.1.x-dev
- 4.1.7
- 4.1.6
- 4.1.5
- 4.1.4
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2
- 3.1.2
- 3.1.1
- 3.1
- 3.0.1
- 3.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.4.2
- 0.4.1
- 0.4
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2
- dev-dependabot/composer/phpunit/phpunit-tw-11.4.3
- dev-9.0.0-WIP
- dev-7.0.0-WIP
This package is auto-updated.
Last update: 2024-12-20 23:07:08 UTC
README
league/oauth2-server
is a standards compliant implementation of an OAuth 2.0 authorization server written in PHP which makes working with OAuth 2.0 trivial. You can easily configure an OAuth 2.0 server to protect your API with access tokens, or allow clients to request new access tokens and refresh them.
Out of the box it supports the following grants:
- Authorization code grant
- Client credentials grant
- Device authorization grant
- Implicit grant
- Refresh grant
- Resource owner password credentials grant
The following RFCs are implemented:
- RFC6749 "OAuth 2.0"
- RFC6750 "The OAuth 2.0 Authorization Framework: Bearer Token Usage"
- RFC7519 "JSON Web Token (JWT)"
- RFC7636 "Proof Key for Code Exchange by OAuth Public Clients"
- RFC8628 "OAuth 2.0 Device Authorization Grant
This library was created by Alex Bilbie. Find him on Twitter at @alexbilbie.
Requirements
The latest version of this package supports the following versions of PHP:
- PHP 8.1
- PHP 8.2
- PHP 8.3
- PHP 8.4
The openssl
and json
extensions are also required.
All HTTP messages passed to the server should be PSR-7 compliant. This ensures interoperability with other packages and frameworks.
Installation
composer require league/oauth2-server
Documentation
The library documentation can be found at https://oauth2.thephpleague.com. You can contribute to the documentation in the gh-pages branch.
Testing
The library uses PHPUnit for unit tests.
vendor/bin/phpunit
Continuous Integration
We use Github Actions, Scrutinizer, and StyleCI for continuous integration. Check out our configuration files if you'd like to know more.
Community Integrations
- Drupal
- Laravel Passport
- OAuth 2 Server for CakePHP 3
- OAuth 2 Server for Mezzio
- OAuth 2 Server Bundle (Symfony)
- Heimdall for CodeIgniter 4
Changelog
See the project changelog
Contributing
Contributions are always welcome. Please see CONTRIBUTING.md and CODE_OF_CONDUCT.md for details.
Support
Bugs and feature request are tracked on GitHub.
If you have any questions about OAuth please open a ticket here; please don't email the address below.
Security
If you discover any security related issues, please email andrew@noexceptions.io
instead of using the issue tracker.
License
This package is released under the MIT License. See the bundled LICENSE file for details.
Credits
This code is principally developed and maintained by Andy Millington.
Between 2012 and 2017 this library was developed and maintained by Alex Bilbie.
PHP OAuth 2.0 Server is one of many packages provided by The PHP League. To find out more, please visit our website.
Special thanks to all of these awesome contributors.
Additional thanks go to the Mozilla Secure Open Source Fund for funding a security audit of this library.
The initial code was developed as part of the Linkey project which was funded by JISC under the Access and Identity Management programme.