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

On this page you can find all versions of the php package dvicklund/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

Ebay Oauth Client

Code coverage badge

Allows developers to fetch an OAuth token that can be used to call the eBay Developer REST APIs using PHP.

What is OAuth

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 may be used is available at developer.ebay.com. See: https://developer.ebay.com/api-docs/static/oauth-tokens.html

Installation

Include in your project via composer:

Usage

EbayAuthToken(config)

Create a new instance of EbayAuthToken with a relevant config.

$ebayAuthToken->getApplicationToken(environment)

Generate client credential token.

$ebayAuthToken->generateUserAuthorizationUrl(environment, scopes[, options])

Generate user consent authorization url.

You can also provide optional values:\ state: An opaque value used by the client to maintain state between the request and callback.\ prompt: Force a user to log in when you redirect them to the Grant Application Access page, even if they already have an existing user session.

The method call above could also be done as

$ebayAuthToken->exchangeCodeForAccessToken(environment, code)

Get a User access token.

$ebayAuthToken->getAccessToken(environment, refreshToken, scopes)

Use a refresh token to update a User access token (Updating the expired access token).

Library Setup and getting started

  1. Invoke the oauth ebay library as given below

OR

  1. If you want to get your application credentials such as AppId, DevId, and CertId. Refer to Creating eBay Developer Account for details on how to get these credentials.
  2. You can refer to Example.php for an example of how to use credentials.
  3. For Authorization code grant
    1. Get user consent url using
    2. Open the generateUserAuthorizationUrl in the browser, which allows you to login in to ebay site. You will get an authorization code.
    3. Pass the authorization code retrieved in the above step to exchangeCodeForAccessToken method using

Configure credentials

Create a config JSON file in your application. The config file should contain your eBay applications keys: App Id, Cert Id & Dev Id. A sample config file is available at demo/ebay-config-sample.json. You could also set these parameters in a .env file, and pass them into the $options object during setup.

Types of Tokens

There are two types of tokens you will need to use.

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 supported. Refer to eBay Developer Portal

Client Credentials

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

Authorization Code

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

Read more about this grant type at oauth-authorization-code-grant.

Refresh Token

This grant type can be performed by simply using . Usually, access tokens are short lived. If the access token is expired, the caller can use the refresh token to generate a new access token. Read more about using a refresh token to update a user access token

Questions/problems?

If you have found a bug/issue, please file it on GitHub.

References

  1. https://developer.ebay.com/api-docs/static/oauth-tokens.html

  2. https://developer.ebay.com/api-docs/static/oauth-quick-ref-user-tokens.html

  3. https://developer.ebay.com/api-docs/static/oauth-gen-app-token.html

  4. https://developer.ebay.com/my/keys

License

Copyright (c) 2023 David Vicklund.

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

Useful links


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

PHP Build Version
Package Version
Requires php Version >=7.4
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 dvicklund/ebay-oauth-php-client contains the following files

Loading the files please wait ....