pde159/yii2-authclient-microsoft

Microsoft 365/Azure auth provider

0.0.2 2020-07-27 14:04 UTC

This package is auto-updated.

Last update: 2024-10-27 23:35:20 UTC


README

Yii2 authclient for Microsoft 365/Azure

Installation

With Composer :

composer require pde159/yii2-authclient-microsoft

or add to "require" section to composer.json

"pde159/yii2-authclient-microsoft": "*"

Usage

First create you Application via Microsoft Azure Portal and configure :

  • a redirect URI
  • a secret key
  • set to all tenant for multitenant availability

And add the Oauth2 client to your Yii2 configuration component section

'components' => [
    'authClientCollection' => [
        'class'   => \yii\authclient\Collection::className(),
        'clients' => [
            'microsoft' => [
                'class'         => 'pde159\authclient\Microsoft',
                'returnUrl'     => 'http://localhost/user/login',
                'clientId'      => 'clientIDyoudefinedInAzurePortal',
                'clientSecret'  => 'SecretyoucratedinAzurePortal',
            ],
            ...
        ],
    ],
    ...
]