PHPackages                             eaglexboy/ebay-oauth-php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. eaglexboy/ebay-oauth-php-client

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

eaglexboy/ebay-oauth-php-client
===============================

eBay OAuth Client which helps in easy integration

v1.0.8(1y ago)0975↓100%1Apache-2.0PHPPHP &gt;=8.1

Since Sep 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/eaglexboy/ebay-oauth-php-client)[ Packagist](https://packagist.org/packages/eaglexboy/ebay-oauth-php-client)[ RSS](/packages/eaglexboy-ebay-oauth-php-client/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (4)Versions (10)Used By (0)

This is a port of the [ebay-oauth-java-client](https://github.com/eBay/ebay-oauth-java-client)

eBay OAuth Client Library (PHP)
===============================

[](#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
-----------------

[](#what-is-oauth-20)

[OAuth 2.0](https://tools.ietf.org/html/rfc6749) 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](https://developer.ebay.com/api-docs/static/oauth-tokens.html).

Supported Languages
-------------------

[](#supported-languages)

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

Installation
------------

[](#installation)

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

### Composer

[](#composer)

Add the library to your `composer.json`

```
{
    "require": {
      "eaglexboy/ebay-oauth-php-client": "^1.0"
    }
}

```

or via command line

```
composer require eaglexboy/ebay-oauth-php-client

```

Getting Started
---------------

[](#getting-started)

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

Library Setup and getting started
---------------------------------

[](#library-setup-and-getting-started)

1. Ensure you have a config file in your source code of type [YAML](http://yaml.org/). 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](https://developer.ebay.com/api-docs/static/creating-edp-account.html) for details on how to get these credentials.
3. Once the file is created, call `CredentialUtil.loadFile();` 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
---------------

[](#types-of-tokens)

There are mainly two types of tokens in usage.

### Application Token

[](#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

[](#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
-------------------------------

[](#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](https://developer.ebay.com/api-docs/static/oauth-tokens.html)

### Grant Type: Client Credentials

[](#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](https://developer.ebay.com/api-docs/static/oauth-client-credentials-grant.html)

### Grant Type: Authorization Code

[](#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`](https://developer.ebay.com/api-docs/static/oauth-authorization-code-grant.html) and [`oauth-auth-code-grant-request`](https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html)

### Grant Type: Refresh Token

[](#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](https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html)

Contribution
------------

[](#contribution)

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

Libraries used
--------------

[](#libraries-used)

- [monolog](https://seldaek.github.io/monolog/)
- symfony
    - [YAML](https://symfony.com/doc/current/components/yaml.html)
    - [HTTP Client](https://symfony.com/doc/current/http_client.html)

Developers and Contributors
---------------------------

[](#developers-and-contributors)

1. [Eleazar Castellanos](https://github.com/eaglexboy)

References
----------

[](#references)

1.
2.
3.

License
-------

[](#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 .

###  Health Score

32

—

LowBetter than 74% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

9

Last Release

535d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a6e909142682d01fb69cb3206140eaee4c6b73654f8600a6eb571c0d8d8b1be?d=identicon)[eaglexboy](/maintainers/eaglexboy)

---

Top Contributors

[![eaglexboy](https://avatars.githubusercontent.com/u/9122907?v=4)](https://github.com/eaglexboy "eaglexboy (2 commits)")

---

Tags

authenticationebayebay-apioauthoauth2phpclientoauthebay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eaglexboy-ebay-oauth-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/eaglexboy-ebay-oauth-php-client/health.svg)](https://phpackages.com/packages/eaglexboy-ebay-oauth-php-client)
```

###  Alternatives

[happyr/linkedin-api-client

LinkedIn API client. Handles OAuth, CSRF protection. Easy to implement and extend. This is a standalone library for any composer project.

2031.6M11](/packages/happyr-linkedin-api-client)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

251.7M1](/packages/mollie-oauth2-mollie-php)[omines/oauth2-gitlab

GitLab OAuth 2.0 Client Provider for The PHP League OAuth2-Client

37703.9k12](/packages/omines-oauth2-gitlab)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
