PHPackages                             lemonstand/oauth2-amazon - 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. lemonstand/oauth2-amazon

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

lemonstand/oauth2-amazon
========================

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

51045[1 PRs](https://github.com/lemonstand/oauth2-amazon/pulls)PHP

Since May 29Pushed 8y ago4 watchersCompare

[ Source](https://github.com/lemonstand/oauth2-amazon)[ Packagist](https://packagist.org/packages/lemonstand/oauth2-amazon)[ RSS](/packages/lemonstand-oauth2-amazon/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Amazon Provider for OAuth 2.0 Client
====================================

[](#amazon-provider-for-oauth-20-client)

[![Build Status](https://camo.githubusercontent.com/418e5e05b4740458dad06f1c08c3c60b3d2d30ee15ad9d7ac7aaab1918f7d413/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c656d6f6e7374616e642f6f61757468322d616d617a6f6e2e737667)](https://travis-ci.org/lemonstand/oauth2-amazon)[![Coverage Status](https://camo.githubusercontent.com/dbbd57e90a415a95e720e9221af1470df030c47fdc03c71b4c4bdca3f4637884/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6c656d6f6e7374616e642f6f61757468322d616d617a6f6e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/lemonstand/oauth2-amazon?branch=master)[![License](https://camo.githubusercontent.com/e798693607882109dbd006528889176996e46045ece8edf52e8c68156a3ef351/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c656d6f6e7374616e642f6f61757468322d616d617a6f6e2e737667)](https://github.com/lemonstand/oauth2-amazon/blob/master/LICENSE)[![Total Downloads](https://camo.githubusercontent.com/50f3635bdde4dc0bb3c81642c4bcf0fd79c6ba13556b41bc47c40000ba0404f7/68747470733a2f2f706f7365722e707567782e6f72672f6c656d6f6e7374616e642f6f61757468322d616d617a6f6e2f646f776e6c6f616473)](https://packagist.org/packages/lemonstand/oauth2-amazon)

This package provides Amazon OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

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

[](#installation)

To install, use composer:

```
composer require lemonstand/oauth2-amazon

```

Usage
-----

[](#usage)

Usage is the same as The League's OAuth client, using `LemonStand\OAuth2\Client\Provider\Amazon` as the provider.

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new LemonStand\OAuth2\Client\Provider\Amazon([
    'clientId' => 'YOUR_CLIENT_ID',
    'clientSecret' => 'YOUR_CLIENT_SECRET',
    'redirectUri' => 'http://your-redirect-uri',
]);

$provider->testMode = true; // Allows you to work in Amazon's Sandbox environment.

if (isset($_GET['code']) && $_GET['code']) {
    $token = $this->provider->getAccessToken('authorizaton_code', [
        'code' => $_GET['code']
    ]);

    // Returns an instance of League\OAuth2\Client\User
    $user = $this->provider->getUserDetails($token);
    $uid = $provider->getUserUid($token);
    $email = $provider->getUserEmail($token);
    $screenName = $provider->getUserScreenName($token);
}
```

### Refreshing A Token

[](#refreshing-a-token)

```
$provider = new LemonStand\OAuth2\Client\Provider\Amazon([
    'clientId' => 'YOUR_CLIENT_ID',
    'clientSecret' => 'YOUR_CLIENT_SECRET',
    'redirectUri' => 'http://your-redirect-uri',
]);

$grant = new \League\OAuth2\Client\Grant\RefreshToken();
$token = $provider->getAccessToken($grant, ['refresh_token' => $refreshToken]);
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb3f3ba8ea2b0d3eee8567205fb16f2bca9fe1e251bf97382952d7728866bf76?d=identicon)[lemonstand](/maintainers/lemonstand)

---

Top Contributors

[![aperdomo](https://avatars.githubusercontent.com/u/3967712?v=4)](https://github.com/aperdomo "aperdomo (7 commits)")[![ChrisZieba](https://avatars.githubusercontent.com/u/2230570?v=4)](https://github.com/ChrisZieba "ChrisZieba (1 commits)")

### Embed Badge

![Health badge](/badges/lemonstand-oauth2-amazon/health.svg)

```
[![Health](https://phpackages.com/badges/lemonstand-oauth2-amazon/health.svg)](https://phpackages.com/packages/lemonstand-oauth2-amazon)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

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