Registry / auth / league-oauth2-client

league-oauth2-client

JSON →
library2.9.0phppackagistunverified

A PHP library for integrating OAuth 2.0 authorization flows into applications.

composer require league/oauth2-client
INSTALL
IMPORT
SIG · LEAGUE-OAUTH2-CLIE
L
league-oauth2-client
authphpv2.9.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GenericProvider
use League\OAuth2\Client\Provider\GenericProvider;

Obtain an access token using the authorization code grant.

use League\OAuth2\Client\Provider\GenericProvider; $provider = new GenericProvider([ 'clientId' => 'your-client-id', 'clientSecret' => 'your-client-secret', 'redirectUri' => 'https://your-redirect-uri', 'urlAuthorize' => 'https://provider.com/authorize', 'urlAccessToken' => 'https://provider.com/token', 'urlResourceOwnerDetails' => 'https://provider.com/user' ]); $accessToken = $provider->getAccessToken('authorization_code', [ 'code' => $_GET['code'] ]); echo $accessToken->getToken();
Debug
Known issues
breakingRequires PHP 8.0+ as of version 2.9.0
fix
Upgrade PHP to 8.0 or higher, or use an older version (e.g., 2.8.x) for PHP 7.4.
affects: >=2.9.0
Upgrade
Version history
2.9.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
league-oauth2-client — pip install league-oauth2-client · libregistry