PHPackages                             longthanhtran/yii2-oauth2-resource-server - 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. longthanhtran/yii2-oauth2-resource-server

ActiveYii2-extension[Authentication &amp; Authorization](/categories/authentication)

longthanhtran/yii2-oauth2-resource-server
=========================================

OAuth 2.0 Resource Server

1.0.0(4y ago)00MITPHPPHP &gt;= 7.4 | 8.0

Since Sep 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/longthanhtran/yii2-oauth2-resource-server)[ Packagist](https://packagist.org/packages/longthanhtran/yii2-oauth2-resource-server)[ RSS](/packages/longthanhtran-yii2-oauth2-resource-server/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Yii2 based OAuth2 Resource Server
=================================

[](#yii2-based-oauth2-resource-server)

Introduction.
-------------

[](#introduction)

The package is a wrapper with League's OAuth2 Server package to implement Resource Server function. This take bearer `access_token` and validates against define OAuth2 authz server before accepting the request.

Current support grant to communicate with OAuth2 authz server is `client_credentials`

Setup.
------

[](#setup)

### Parameters.

[](#parameters)

- Prepare the pair of `clientId` and `clientSecret` inside `@app/config/params.php` file. Authorization Server url also has it detail.

```
...
  'resourceServer' => [
    'authzServerUrl' => 'your-oauth-authz-server-url',
    'publicKey'      => 'your-public-key-path'
  ],
  'clientCredentials' => [
    'clientId'     => 'your-client-id',
    'clientSecret' => 'your-client-secret',
  ]
...
```

### OAuthRequester component

[](#oauthrequester-component)

- Inside `@app/config/web.php`, put component definition for `OAuthRequest`

```
...
  'oauthRequester' => [
    'class' => 'longthanhtran\oauth2\filters\OAuthRequester'
  ]
...
```

Usage
-----

[](#usage)

From your (rest) controller, attach the `RequestValidator` in behaviors function, e.g

```
public function behaviors()
{
  $behaviors = parent::behaviors();

  $behaviors['authenticator'] = [
    'class' => 'longthanhtran\oauth2\filters\RequestValidator'
  ];

  return $behaviors;
}
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Unknown

Total

1

Last Release

1748d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/429373?v=4)[longtran](/maintainers/longtran)[@longtran](https://github.com/longtran)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/longthanhtran-yii2-oauth2-resource-server/health.svg)

```
[![Health](https://phpackages.com/badges/longthanhtran-yii2-oauth2-resource-server/health.svg)](https://phpackages.com/packages/longthanhtran-yii2-oauth2-resource-server)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

123256.9k1](/packages/ellaisys-aws-cognito)

PHPackages © 2026

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