Download the PHP package eaglexboy/ebay-oauth-php-client without Composer

On this page you can find all versions of the php package eaglexboy/ebay-oauth-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ebay-oauth-php-client

This is a port of the ebay-oauth-java-client

eBay OAuth Client Library (PHP)

eBay OAuth client library is a simple and easy-to-use library for integrating with eBay OAuth and designed to be used for OAuth 2.0 specification supported by eBay. There are multiple standard clients that can be used with eBay OAuth, such as OpenID Connect client. However, this library in addition to functioning as a simple eBay OAuth client, helps with additional features such as cached App tokens. There are also future enhancements planned to add id_token support, 'login with eBay' support etc.,

What is OAuth 2.0

OAuth 2.0 is the most widely used standard for authentication and authorization for API based access. The complete end to end documentation on how eBay OAuth functions is available at developer.ebay.com.

Supported Languages

This library is created as a PHP project and can be used as a dependency in a PHP based application

Installation

Install in your project by downloading the repo and extracting in your project or using composer

Composer

Add the library to your composer.json

or via command line

Getting Started

All interactions with this library can be performed using oauth2Api = new OAuth2Api();

Library Setup and getting started

  1. Ensure you have a config file in your source code of type YAML. Refer to ebay-config-sample.yaml.
  2. This file would hold all your application credentials such as AppId, DevId, and CertId. Refer to Creating eBay Developer Account for details on how to get these credentials.
  3. Once the file is created, call CredentialUtil.loadFile(<your-config-location>); to load the credentials.
  4. It is recommended to load the credentials during startup time (initialization) to prevent runtime delays.
  5. Once the credentials are loaded, call any operation on OAuth2Api

Types of Tokens

There are mainly two types of tokens in usage.

Application Token

An application token contains an application identity which is generated using client_credentials grant type. These application tokens are useful for interaction with application specific APIs such as usage statistics etc.,

User Token

A user token (access token or refresh token) contains a user identity and the application's identity. This is usually generated using the authorization_code grant type or the refresh_token grant type.

Supported Grant Types for OAuth

All of the regular OAuth 2.0 specifications such as client_credentials, authorization_code, and refresh_token are all supported. Refer to eBay Developer Portal

Grant Type: Client Credentials

This grant type can be performed by simply using OAuth2Api.getApplicationToken(). Read more about this grant type at oauth-client-credentials-grant

Grant Type: Authorization Code

This grant type can be performed by a two step process. Call OAuth2Api.generateUserAuthorizationUrl() to get the Authorization URL to redirect the user to. Once the user authenticates and approves the consent, the callback need to be captured by the redirect URL setup by the app and then call OAuth2Api.exchangeCodeForAccessToken() to get the refresh and access tokens.

Read more about this grant type at oauth-authorization-code-grant and oauth-auth-code-grant-request

Grant Type: Refresh Token

This grant type can be performed by simply using OAuth2Api.getAccessToken(). Usually access tokens are short lived and if the access token is expired, the caller can use the refresh token to generate a new access token. Read more about it at Using a refresh token to update a user access token

Contribution

Contributions in terms of patches, features, or comments are always welcome. Refer to CONTRIBUTING for guidelines. Submit Github issues for any feature enhancements, bugs, or documentation problems as well as questions and comments.

Libraries used

Developers and Contributors

  1. Eleazar Castellanos

References

  1. https://developer.ebay.com/api-docs/static/oauth-token-types.html
  2. https://developer.ebay.com/api-docs/static/oauth-tokens.html
  3. https://developer.ebay.com/my/keys

License

Copyright (c) 2024 EC Systems Design.

Use of this source code is governed by a Apache-2.0 license that can be found in the LICENSE file or at https://opensource.org/licenses/Apache-2.0.


All versions of ebay-oauth-php-client with dependencies

PHP Build Version
Package Version
Requires monolog/monolog Version ^3.7
php Version >=8.1
symfony/http-client Version ^7.1
symfony/yaml Version ^7.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package eaglexboy/ebay-oauth-php-client contains the following files

Loading the files please wait ....