PHP League's base library for OAuth 2.0 sign-in with any provider
open sourceMITfree
OAuth 2.0 Client (league/oauth2-client) is a PHP library from The PHP League that gives an application a base for the OAuth 2.0 login flow behind "Connect with Google/GitHub" buttons, without handling the details of RFC 6749 itself. It works with any provider that follows the OAuth 2.0 Authorization Framework, and its GenericProvider connects to any service that uses Bearer tokens. Official League clients and third-party ones extend it for providers such as Facebook, GitHub, Google, Instagram and LinkedIn, and you can write your own.
Problems it solves
- add 'Sign in with Google' and GitHub login to my PHP app without writing the OAuth flow myself
- connect a PHP backend to an OAuth 2.0 API that issues Bearer tokens
- support several OAuth providers in PHP behind one interface
Features
- GenericProvider for any OAuth 2.0 service using Bearer tokens
- official League and third-party provider clients
- a guide to writing your own provider client
- PSR-1, PSR-2, PSR-4 and PSR-7 compliant
Limitations
- Needs PHP 8.2 or later.1
