dev-master
9999999-deveBay OAuth 2.0 Client Provider for The PHP League OAuth2-Client
MIT
The Requires
- php >=5.6.0
- league/oauth2-client ^2.0
by Neil Crookes
authentication authorization oauth sso oauth2 identity idp single sign on ebay ebay api
Wallogit.com
2017 © Pedro Peláez
eBay OAuth 2.0 Client Provider for The PHP League OAuth2-Client
This package provides Ebay OAuth 2.0 support for the PHP League's OAuth 2.0 Client., (*1)
To install, use composer:, (*2)
composer require neilcrookes/oauth2-ebay
Usage is the same as The League's OAuth client, using NeilCrookes\OAuth2\Client\Provider\Ebay as the provider., (*3)
$provider = new \NeilCrookes\OAuth2\Client\Provider\Ebay([
'clientId' => 'YOUR EBAY APP ID',
'clientSecret' => 'YOUR EBAY CERTIFICATE ID',
'redirectUri' => 'YOUR EBAY "RU" NAME',
'sandbox' => true, //defaults to false, i.e. production
'http_errors' => false, // Optional. Means Guzzle Exceptions aren't thrown on 4xx or 5xx responses from eBay, allowing you to detect and handle them yourself
], [
'optionProvider' => new \League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider()
]);
$accessToken = $provider->getAccessToken('authorization_code', [
'code' => $_GET['code']
]);
$ebayUser = $provider->getResourceOwner($accessToken);
echo $ebayUser->getId(); // eBay User's user id
echo $ebayUser->getEmail(); // eBay User's email address
eBay OAuth 2.0 Client Provider for The PHP League OAuth2-Client
MIT
authentication authorization oauth sso oauth2 identity idp single sign on ebay ebay api