League/oauth2-client
The OAuth 2.0 login flow, seen commonly around the web in the form of “Connect with Facebook/Google/etc.” buttons, is a common integration added to web applications, but it can be tricky and tedious to do right. To help, we’ve created the league/oauth2-client
package, which provides a base for integrating with various OAuth 2.0 providers, without overburdening your application with the concerns of RFC 6749.
Installation
This package establishes a convenient base of interfaces and abstract classes, allowing developers to create OAuth 2.0 clients that interface with a wide-variety of OAuth 2.0 providers.
⚠️ Attention! There are already many official or third-party provider clients available. Check these before using this base package. A client might already exist for your provider.
This base package also includes a GenericProvider
class, which works out-of-the-box with many OAuth 2.0 providers who use Bearer tokens. If you would like to use the GenericProvider
instead of one of the specific provider clients, you may require this package directly with Composer:
$ composer require league/oauth2-client
You do not need to require this package directly if using one of the official or third-party provider clients.