PHPackages                             istvan0304/yii2-office365-oauth - 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. istvan0304/yii2-office365-oauth

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

istvan0304/yii2-office365-oauth
===============================

Office 365 login for yii2 app

2.1.0(1y ago)0409↓50%MITPHP

Since Apr 25Pushed 1y ago1 watchersCompare

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

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

Yii2 sign in with microsoft work or school account (Office 365)
===============================================================

[](#yii2-sign-in-with-microsoft-work-or-school-account-office-365)

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

[](#requirements)

- php &gt;=7.2

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

[](#installation)

The preferred way to install this extension is through composer.

- Run

    $ php composer.phar require istvan0304/yii2-office365-oauth "dev-master"

or add:

```
    "istvan0304/yii2-office365-oauth": "dev-master"

```

to the require section of your application's composer.json file.

Usage
-----

[](#usage)

- In controller apply:

    ```
      public function actions()
      {
        return [
          'o365auth' => [
            'class' => 'cranedev\authclientO365\Office365AuthAction',
            'successCallback' => [$this, 'onAuthSuccess'],
          ],
        ];
      }

      public function onAuthSuccess($client)
      {
          // Handle login...
    }

    ```
- In view:

    ```

    ```

    OR create a link
- Set Environment variables

    - Setup http client

        ```
          return [
            'components' => [
                'authClientCollection' => [
                  'class' => 'yii\authclient\Collection',
              'clients' => [
                  'o365' => [
                      'class' => 'istvan0304\yii2office365oauth\src\Office365OAuth',
                      'clientId' => getenv('AUTH_CLIENT_ID'),
                      'clientSecret' => getenv('AUTH_CLIENT_SECRET'),
                      'authUrl' => getenv('AUTH_URL'),
                      'tokenUrl' => getenv('AUTH_TOKEN_URL'),
                      'apiBaseUrl' => getenv('GRAPH_URL'),
                      'returnUrl' => getenv('AUTH_RETURN_URL'),
                      'scope' => getenv('AUTH_SCOPE'),
                      'resource' => getenv('AUTH_RESOURCE_URL'),
                      'title' => 'Title',
                //    'login_hint' => '',
                      'selectParams' => 'id,displayName,userPrincipalName,mail,photo,mobilePhone,preferredLanguage,onPremisesExtensionAttributes',
                      //'proxy' => getenv('AUTH_PROXY_URL'),
                      ],
                  ],
                  //...
                ],
              // ...
          ];

        ```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~58 days

Total

4

Last Release

573d ago

Major Versions

1.0.1 → 2.0.02024-04-25

### Community

Maintainers

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

---

Top Contributors

[![istvan0304](https://avatars.githubusercontent.com/u/19621571?v=4)](https://github.com/istvan0304 "istvan0304 (4 commits)")[![steve0304pte](https://avatars.githubusercontent.com/u/242409783?v=4)](https://github.com/steve0304pte "steve0304pte (1 commits)")

### Embed Badge

![Health badge](/badges/istvan0304-yii2-office365-oauth/health.svg)

```
[![Health](https://phpackages.com/badges/istvan0304-yii2-office365-oauth/health.svg)](https://phpackages.com/packages/istvan0304-yii2-office365-oauth)
```

###  Alternatives

[xj/yii2-oauth

yii2-oauth

10927.8k1](/packages/xj-yii2-oauth)[budyaga/yii2-users

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

409.1k](/packages/budyaga-yii2-users)[lowbase/yii2-user

Yii2 user module

131.5k2](/packages/lowbase-yii2-user)

PHPackages © 2026

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