PHPackages                             virgantara/unida-apps-support - 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. virgantara/unida-apps-support

ActiveLibrary

virgantara/unida-apps-support
=============================

A collection of UNIDA Gontor Apps Components.

v1.0.4(1y ago)03MITPHPPHP &gt;=7.4

Since Dec 18Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/virgantara/Unida-Apps-Support)[ Packagist](https://packagist.org/packages/virgantara/unida-apps-support)[ RSS](/packages/virgantara-unida-apps-support/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

🚀 Support Components for Yii2 UNIDA Gontor Apps
===============================================

[](#-support-components-for-yii2-unida-gontor-apps)

[![License](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)[![PHP](https://camo.githubusercontent.com/61ac6fd08d26de053c71a00c885c7d3d924ae0babf4d146e509dd73ddd6521cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e342d627269676874677265656e)](https://camo.githubusercontent.com/61ac6fd08d26de053c71a00c885c7d3d924ae0babf4d146e509dd73ddd6521cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e342d627269676874677265656e)[![Yii2](https://camo.githubusercontent.com/d731221643b09f3e00a769a836a95aa2b2fedb3d9d6811af0b56d2f936acb955/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d70617469626c652d596969322d626c7565)](https://camo.githubusercontent.com/d731221643b09f3e00a769a836a95aa2b2fedb3d9d6811af0b56d2f936acb955/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d70617469626c652d596969322d626c7565)

Welcome to the **Apps Support Components** package! This collection of Yii2 components simplifies authentication and token management for your applications. Whether you need OAuth2 integration, token handling, or application-based authentication, this package has got you covered! 🌟

---

📦 Components Overview
---------------------

[](#-components-overview)

### **Setup**

[](#setup)

Put this in your params.php or params-local.php

```
// Previous params codes
'oauth' => [
    'client_id' => 'your-client-id',
    'client_secret' => 'your-client-secret',
    'baseurl' => 'https://your-oauth-server.com',
    'redirectUri' => 'https://your-app.com/callback',
],
```

### **Installation**

[](#installation)

1. add this to composer.json `"repositories"`

```
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/virgantara/Unida-Apps-Support.git"
        }
    ]
```

2. add this to composer.json `"require"`

```
    "require": {
        "virgantara/unida-apps-support": "dev-master"
    }
```

3. Update your composer by running this code

```
composer update -vvv
```

4. Open your `config/web.php`, add the following code in `components`

```
'components' => [
    ...
    'tokenService' => [
        'class' => 'virgantara\components\TokenService',
    ],
    'aplikasi' => [
        'class' => 'virgantara\components\AplikasiAuth',
        'baseurl' => $params['oauth']['baseurl'],
    ],
    'tokenManager' => [
        'class' => 'virgantara\components\TokenManager',
    ],
    'oauth2' => [
        'class' => 'virgantara\components\OAuth2Client',
        'tokenValidationUrl' => $params['oauth']['baseurl'], // Endpoint for token validation
        'tokenRefreshUrl' => $params['oauth']['baseurl'],
        'client_id' => $params['oauth']['client_id'],
        'client_secret' => $params['oauth']['client_secret'],
    ],
]
```

5. Open your SiteController.php, add the following codes:

```
    public function actionAuthCallback()
    {
        try {
            $accessToken = Yii::$app->request->get('access_token');
            $refreshToken = Yii::$app->request->get('refresh_token');

            Yii::$app->tokenService->handleAuthCallback($accessToken, $refreshToken);

            return $this->redirect(['site/index']);
        } catch (\Exception $e) {
            return $this->handleException($e);
        }
    }

    protected function handleException($e)
    {
        Yii::$app->session->setFlash('danger', $e->getMessage());
        return $this->redirect(['site/index']);
    }

    public function actionCallback()
    {
        try {
            $receivedJwt = Yii::$app->request->get('state');
            $authCode = Yii::$app->request->get('code');

            Yii::$app->tokenService->handleCallback($receivedJwt, $authCode);

            return $this->redirect(['site/index']);
        } catch (\Exception $e) {
            return $this->handleException($e);
        }
    }
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance47

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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 ~0 days

Total

4

Last Release

510d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9afa8cf7d5fe8638468067f3afb9649b24eed544d8e10ca54f04802baf503790?d=identicon)[virgantara](/maintainers/virgantara)

---

Top Contributors

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

---

Tags

componentsyii2UNIDA GontorGontor

### Embed Badge

![Health badge](/badges/virgantara-unida-apps-support/health.svg)

```
[![Health](https://phpackages.com/badges/virgantara-unida-apps-support/health.svg)](https://phpackages.com/packages/virgantara-unida-apps-support)
```

###  Alternatives

[kakadu-dev/yii2-jwt-auth

Extension provide JWT auth for Yii2

105.8k](/packages/kakadu-dev-yii2-jwt-auth)

PHPackages © 2026

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