PHPackages                             leammas/yii2-megaplanauth - 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. leammas/yii2-megaplanauth

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

leammas/yii2-megaplanauth
=========================

Provides ability to auth users using Megaplan Auth API

0511PHP

Since Jul 9Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Leammas/yii2-megaplanauth)[ Packagist](https://packagist.org/packages/leammas/yii2-megaplanauth)[ RSS](/packages/leammas-yii2-megaplanauth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 Megaplan Auth Client
=========================

[](#yii2-megaplan-auth-client)

Provides ability to auth users using Megaplan Auth API Specification can be found [there](http://help.megaplan.ru/API_authorization).

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist leammas/yii2-megaplanauth "*"

```

or add

```
"leammas/yii2-megaplanauth": "*"

```

to the require section of your `composer.json` file.

Requirements
------------

[](#requirements)

- Yii2
- PHP 5.4+
- Curl and php-curl installed

Usage
-----

[](#usage)

Once the extension is installed, use it as application component :

```
    'components' => [
        ...
        'mpauth' => [
            'class' => 'leammas\yii2\megaplanauth\Megaplanauth',
            'url' => 'http://some.url',
            'timeout' => 10
        ],
        ...

```

The main method `authenticate` accepts two parameters `username` and `password`. Use it somewhere in your form or user model validation. It will return array with user data if succeed or throw MPAuthException with error message.

```
    /**
     * @param $password
     * @return bool
     */
    public function validatePassword($password)
    {
        try
        {
            $success = Yii::$app->mpauth->authenticate($this->username, $password);
            // if you don't use Megaplan user id's or employee id's, just replace it with `return true;`
            return $success['EmployeeId'] == $this->id;
        }
        catch(MPAuthException $e)
        {
            Yii::trace('MPAuth Fail: ' . $e->getMessage());
            return false;
        }
    }
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f75b53b3cadaf38ac69edb1a735f9f1c64b7c8a6cf9c3ef8485ef218776e355?d=identicon)[leammas](/maintainers/leammas)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/leammas-yii2-megaplanauth/health.svg)

```
[![Health](https://phpackages.com/badges/leammas-yii2-megaplanauth/health.svg)](https://phpackages.com/packages/leammas-yii2-megaplanauth)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[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)[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

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

PHPackages © 2026

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