# OAuth 2.0 Server

> A spec-compliant OAuth 2.0 authorization and resource server library for PHP

Source: https://talira.ai/catalog/oauth-2-0-server-cehqsc2t
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [security / auth / oauth server](https://talira.ai/categories/security/auth/oauth-server)
- Licence: MIT[^1]
- Pricing: Free[^1]
- Free tier: yes[^1]
- Supports: [OAuth 2.0](https://talira.ai/standards/oauth-2-0.md)[^3]
- Backed by: [The League of Extraordinary Packages](https://talira.ai/orgs/thephpleague.md)

league/oauth2-server is a standards-compliant OAuth 2.0 authorization server written in PHP, from The League of Extraordinary Packages and created by Alex Bilbie. It issues, refreshes and validates access tokens to protect an API. Out of the box it supports the authorization code (with PKCE), implicit, client credentials, password, refresh token and device authorization grants. You supply storage through its repository and entity interfaces, so it works with any database or framework.

## Links

- Website: https://oauth2.thephpleague.com/
- GitHub: https://github.com/thephpleague/oauth2-server
- Docs: https://oauth2.thephpleague.com/

## Problems it solves

- add an OAuth 2.0 authorization server to my PHP API
- issue and refresh access tokens for third-party apps that call my API
- support the device authorization grant and PKCE in a PHP backend
- protect API routes with bearer tokens in a PSR-7 PHP app

## Features

- Authorization code grant with PKCE (RFC 7636)
- Client credentials, password, implicit and refresh token grants
- Device authorization grant (RFC 8628)
- JWT access tokens (RFC 7519) and bearer token usage (RFC 6750)
- Resource server middleware for PSR-7 requests
- Storage through repository and entity interfaces
- Domain events

## Trust

Overall: 0.58 out of 1.
Signals: maintenance 0.69, adoption 0.76, momentum 0.48, community 0.90, backing 0.30, extensibility 0.00.

- last commit 9 days ago
- 13 commits in the last 90 days
- latest release 9.5.0 9 days ago
- 6.7k GitHub stars
- 182 contributors
- accepts sponsorship (Github)
- backed by The League of Extraordinary Packages

## Alternatives

- [Ory Hydra](https://talira.ai/catalog/ory-hydra-5zw4xv65.md): Open source, OpenID Certified OAuth 2.0 server and OpenID Connect provider

## Sources

[^1]: https://github.com/thephpleague/oauth2-server/blob/master/LICENSE (checked 25 Nov 2026)
[^2]: https://oauth2.thephpleague.com/ (checked 25 Nov 2026)
[^3]: https://github.com/thephpleague/oauth2-server/blob/master/README.md (checked 29 Nov 2026)
