league/oauth1-client
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
guzzlehttp/guzzle | 7.8.1 | 112.34 kB | MIT | prod | |
guzzlehttp/psr7 | 2.6.2 | 76.41 kB | MIT | prod |
The league/oauth1-client is an OAuth RFC 5849 standards-compliant library designed for performing authentication against OAuth 1 servers. It seemingly makes it trivial to integrate and authenticate commonly used services like Twitter, Tumblr, Bitbucket, Trello, Magento, Uservoice, and Xing, amongst others. The library requires PHP 7.1+, ensuring compatibility with modern PHP versions.
To use league/oauth1-client, start by installing it via Composer using the command composer require league/oauth1-client
. Once installed, you can set up OAuth 1.0 authentication for a particular service. For servers like Bitbucket, Trello, Tumblr, Twitter, and Xing, initialize a new instance and set 'identifier', 'secret', and 'callback_uri' values. For example,
$server = new League\OAuth1\Client\Server\Twitter([
'identifier' => 'your-identifier',
'secret' => 'your-secret',
'callback_uri' => "http://your-callback-uri/",
'scope' => 'your-application-scope' // optional ('read', 'write'), empty by default
]);
To start authentication, retrieve and store temporary credentials in the session and redirect the user to the server for login. After the user has authenticated and redirected back, you can retrieve token credentials to make calls on their behalf. User information and other resources can be accessed by invoking methods like getUserDetails()
and getUserEmail()
on server instances.
The league/oauth1-client library doesn't explicitly list a dedicated documentation page. However, comprehensive usage instructions and other pertinent details pertaining to the library can be found in the package's README file on its GitHub repository: https://github.com/thephpleague/oauth1-client. To get more acquainted with its usage, you can look at the examples available under the resources/examples directory in the repository.